1. Apr 02, 2019
    • Joseph Tremoulet's avatar
      [SimplifyCFG] Don't split musttail call from ret · fb4d9f72
      Joseph Tremoulet authored
      Summary:
      When inserting an `unreachable` after a noreturn call, we must ensure
      that it's not a musttail call to avoid breaking the IR invariants for
      musttail calls.
      
      Reviewers: fedor.sergeev, majnemer
      
      Reviewed By: majnemer
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60080
      
      llvm-svn: 357485
      fb4d9f72
    • Taewook Oh's avatar
      [SampleProfile] Repeat indirect call promotion only when the target is actually hot. · 6a27c48b
      Taewook Oh authored
      Summary: It is possible that multiple indirect call targets have been promoted for a single callsite from the profiled binary. Current implementation repeats promotion for all these targets as far as the callsite itself is hot (the callsite is assumed to be hot if any one of these targets was "hot" during the profiling). However, even when one of the ICPed target is hot other targets may not, and we should not repeat promotion for "cold" targets.
      
      Reviewers: danielcdh, wmi
      
      Subscribers: hiraditya, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59940
      
      llvm-svn: 357484
      6a27c48b
    • Joseph Tremoulet's avatar
      [PruneEH] Don't split musttail call from ret · b69afa8e
      Joseph Tremoulet authored
      Summary:
      When inserting an `unreachable` after a noreturn call, we must ensure
      that it's not a musttail call to avoid breaking the IR invariants for
      musttail calls.
      
      Reviewers: fedor.sergeev, majnemer
      
      Reviewed By: majnemer
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D60079
      
      llvm-svn: 357483
      b69afa8e
    • Greg Clayton's avatar
      Allow partial UUID matching in Minidump core file plug-in · 838bba9c
      Greg Clayton authored
      Breakpad had bugs in earlier versions where it would take a 20 byte ELF build ID and put it into the minidump file as a 16 byte PDB70 UUID with an age of zero. This would make it impossible to do postmortem debugging with one of these older minidump files.
      
      This fix allows partial matching of UUIDs. To do this we first try and match with the full UUID value, and then fall back to removing the original directory path from the module specification and we remove the UUID requirement, and then manually do the matching ourselves. This allows scripts to find symbols files using a symbol server, place them all in a directory, use the "setting set target.exec-search-paths" setting to specify the directory, and then load the core file. The Target::GetSharedModule() can then find the correct file without doing any other matching and load it.
      
      Tests were added to cover a partial UUID match where the breakpad file has a 16 byte UUID and the actual file on disk has a 20 byte UUID, both where the first 16 bytes match, and don't match.
      
      Differential Revision: https://reviews.llvm.org/D60001
      
      llvm-svn: 357482
      838bba9c
    • Jonas Paulsson's avatar
      [SystemZ] Improve instruction selection of 64 bit shifts and rotates. · f76fe454
      Jonas Paulsson authored
      For shift and rotate instructions that only use the last 6 bits of the shift
      amount, a shift amount of (x*64-s) can be substituted with (-s). This saves
      one instruction and a register:
      
        lhi     %r1, 64
        sr      %r1, %r3
        sllg    %r2, %r2, 0(%r1)
        =>
        lcr     %r1, %r3
        sllg    %r2, %r2, 0(%r1)
      
      Review: Ulrich Weigand
      llvm-svn: 357481
      f76fe454
    • Pierre Gousseau's avatar
      [Driver] Enable -fsanitize-address-globals-dead-stripping by default on PS4. · 0b952711
      Pierre Gousseau authored
      Can be safely enabled on PS4.
      
      Reviewed By: probinson
      
      Differential Revision: https://reviews.llvm.org/D59815
      
      llvm-svn: 357480
      0b952711
    • Brian Gesiak's avatar
      [Transforms] Redundant getValueOperand (NFC) · 1c44ed8b
      Brian Gesiak authored
      `StoreInst::getValueOperand` is identical to `getOperand(0)`, so the call to
      `getOperand(0)` can be replaced. Further, `SI->getValueOperand` is redundantly
      called just a few lines down, despite its return value being stored in variable
      `DV`. No functional change.
      
      llvm-svn: 357479
      1c44ed8b
    • Marshall Clow's avatar
      Special case some duration arithmetic for GCC and PPC because their long... · 3bf63cf3
      Marshall Clow authored
      Special case some duration arithmetic for GCC and PPC because their long double constant folding is broken. Fixes PR#39696.
      
      llvm-svn: 357478
      3bf63cf3
    • Nico Weber's avatar
      gn build: Merge r357469 · 709ee69d
      Nico Weber authored
      llvm-svn: 357477
      709ee69d
    • Nico Weber's avatar
      gn build: Add build files for non-framework xpc clangd bits · 7d3e97d6
      Nico Weber authored
      Differential Revision: https://reviews.llvm.org/D60124
      
      llvm-svn: 357476
      7d3e97d6
    • James Henderson's avatar
      [llvm-objcopy]Allow llvm-objcopy to be used on an ELF file with no section headers · 38cb238f
      James Henderson authored
      This patch fixes https://bugs.llvm.org/show_bug.cgi?id=41293 and
      https://bugs.llvm.org/show_bug.cgi?id=41045. llvm-objcopy assumed that
      it could always read a section header string table. This isn't the case
      when the sections were previously all stripped, and the e_shstrndx field
      was set to 0. This patch fixes this. It also fixes a double space in an
      error message relating to this issue, and prevents llvm-objcopy from
      adding extra space for non-existent section headers, meaning that
      --strip-sections on the output of a previous --strip-sections run
      produces identical output, simplifying the test.
      
      Reviewed by: rupprecht, grimar
      
      Differential Revision: https://reviews.llvm.org/D59989
      
      llvm-svn: 357475
      38cb238f
    • Marshall Clow's avatar
    • Simon Atanasyan's avatar
      [mips] Remove the override of the `isMachineVerifierClean()` · 4cefa15a
      Simon Atanasyan authored
      All issues found by machine verifier in MIPS target have been fixed.
      
      llvm-svn: 357473
      4cefa15a
    • Simon Atanasyan's avatar
      [mips] Use AltOrders to prevent using odd FP-registers · 2634a141
      Simon Atanasyan authored
      To disable using of odd floating-point registers (O32 ABI and
      -mno-odd-spreg command line option) such registers and their
      super-registers added to the set of reserved registers. In general, it
      works. But there is at least one problem - in case of enabled machine
      verifier pass some floating-point tests failed because live ranges of
      register units that are reserved is not empty and verification pass
      failed with "Live segment doesn't end at a valid instruction" error
      message.
      
      There is D35985 patch which tries to solve the problem by explicit
      removing of register units. This solution did not get approval.
      
      I would like to use another approach for prevent using odd floating
      point registers - define `AltOrders` and `AltOrderSelect` for MIPS
      floating point register classes. Such `AltOrders` contains reduced set
      of registers. At first glance, such solution does not break any test
      cases and allows enabling machine instruction verification for all MIPS
      test cases.
      
      Differential Revision: http://reviews.llvm.org/D59799
      
      llvm-svn: 357472
      2634a141
    • Michael Liao's avatar
      [ObjectYAML] Fix build issue · deef7209
      Michael Liao authored
      - ObjectYAML depends on Object as minidump support adds additional
        dependency.
      
      llvm-svn: 357471
      deef7209
    • Alex Bradbury's avatar
      [RISCV] Support assembling @plt symbol operands · f8078f6b
      Alex Bradbury authored
      This patch allows symbols appended with @plt to parse and assemble with the
      R_RISCV_CALL_PLT relocation.
      
      Differential Revision: https://reviews.llvm.org/D55335
      Patch by Lewis Revill.
      
      llvm-svn: 357470
      f8078f6b
    • Pavel Labath's avatar
      Add minidump support to obj2yaml · 3cee663e
      Pavel Labath authored
      Summary:
      This patch adds the code needed to parse a minidump file into the
      MinidumpYAML model, and the necessary glue code so that obj2yaml can
      recognise the minidump files and process them.
      
      Reviewers: jhenderson, zturner, clayborg
      
      Subscribers: mgorny, lldb-commits, amccarth, markmentovai, aprantl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59634
      
      llvm-svn: 357469
      3cee663e
    • Alexander Kornienko's avatar
      [clang-tidy] make getLangOpts return a const ref · 07ef7866
      Alexander Kornienko authored
      llvm-svn: 357468
      07ef7866
    • Simon Pilgrim's avatar
      Fix Wimplicit-fallthrough warning introduced in rL357466. NFCI. · 4bad9c21
      Simon Pilgrim authored
      llvm-svn: 357467
      4bad9c21
    • Strahinja Petrovic's avatar
      [PowerPC] Fix issue with inline asm - soft float mode · 4f839ac1
      Strahinja Petrovic authored
      This patch prevents floating point register
      constraints in soft float mode.
      
      Differential Revision: https://reviews.llvm.org/D59310
      
      llvm-svn: 357466
      4f839ac1
    • Simon Pilgrim's avatar
    • Pavel Labath's avatar
      Make operator==s consistent between c++ and python APIs · 4bc05006
      Pavel Labath authored
      Summary:
      modify-python-lldb.py had code to insert python equality operators to
      some classes. Some of those classes already had c++ equality operators,
      and some didn't.
      
      This makes the situation more consistent, by removing all equality
      handilng from modify-python-lldb. Instead, I add c++ operators to
      classes where they were missing, and expose them in the swig interface
      files so that they are available to python too.
      
      The only tricky case was the SBAddress class, which had an operator==
      defined as a free function, which is not handled by swig. This function
      cannot be removed without breaking ABI, and we cannot add an extra
      operator== member, as that would make equality comparisons ambiguous.
      For this class, I define a python __eq__ function by hand and have it
      delegate to the operator!=, which I have defined as a member function.
      
      This isn't fully NFC, as the semantics of some equality functions in
      python changes slightly, but I believe it changes for the better (e.g.,
      previously SBBreakpoint.__eq__ would consider two breakpoints with the
      same ID as equal, even if they belonged to different targets; now they
      are only equal if they belong to the same target).
      
      Reviewers: jingham, clayborg, zturner
      
      Subscribers: jdoerfert, JDevlieghere, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D59819
      
      llvm-svn: 357463
      4bc05006
    • Hans Wennborg's avatar
      Fix tests after r357452 · 76f2259d
      Hans Wennborg authored
      llvm-svn: 357462
      76f2259d
    • Mikael Holmen's avatar
      Fix compiler warning, remove extra ";" [NFC] · 4ec93171
      Mikael Holmen authored
      At least gcc 7.4 complained with
      ../tools/clang/lib/StaticAnalyzer/Checkers/Taint.cpp:26:53: warning: extra ';' [-Wpedantic]
                                              TaintTagType);
                                                           ^
      
      llvm-svn: 357461
      4ec93171
    • Sander de Smalen's avatar
      Enforce StackID definition in PEI · 7f23e0a6
      Sander de Smalen authored
      There are various places in LLVM where the definition of StackID is not
      properly honoured, for example in PEI where objects with a StackID > 0 are
      allocated on the default stack (StackID0). This patch enforces that PEI
      only considers allocating objects to StackID 0.
      
      Reviewers: arsenm, thegameg, MatzeB
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D60062
      
      llvm-svn: 357460
      7f23e0a6
    • Pavel Labath's avatar
      Fix flakyness in TestCommandScriptImmediateOutput · c5cefa2c
      Pavel Labath authored
      I'm not sure why this surfaced at this particular point, but
      TestCommandScriptImmediateOutput (a pexpect test) had a synchronization
      issue, where the (lldb) promts it was expecting were getting out of
      sync. This happened for two reasons:
      - it did not expect the initial (lldb) prompt we print at startup
      - launchArgs() returned None, which resulted in an extra "target create
        None" command being issued to lldb (and an extra unhandled prompt
        being printed).
      
      Resolving these two issues seems to fix (or at least, improve) the test.
      
      llvm-svn: 357459
      c5cefa2c
    • Fangrui Song's avatar
      [Internalize] Replace uses of std::set with DenseSet · f4219788
      Fangrui Song authored
      This makes it faster and saves 104 bytes for my build.
      
      llvm-svn: 357458
      f4219788
    • Fangrui Song's avatar
      [Internalize] Replace fstream with line_iterator for -internalize-public-api-file · 32029135
      Fangrui Song authored
      This makes my libLLVMipo.so.9svn smaller by 360 bytes.
      
      llvm-svn: 357457
      32029135
    • Pavel Labath's avatar
      Fix llvm_unreachable in TestWriteMemory · 821263fa
      Pavel Labath authored
      The test was hitting llvm_unreachable in
      Platform::GetSoftwareBreakpointTrapOpcode because it could not figure
      out the architecture of the process. Since that is not the purpose of
      the test, I change the test to use an explicit
      CreateTargetWithFileAndTargetTriple command to specify it.
      
      llvm-svn: 357456
      821263fa
    • Pavel Labath's avatar
      PDBFPO: Refactor register reference resolution · 1c4ee160
      Pavel Labath authored
      Summary:
      This refactors moves the register name->number resolution out of the
      FPOProgramNodeRegisterRef class. Instead I create a special
      FPOProgramNodeSymbol class, which holds unresolved symbols, and move the
      resolution into the ResolveRegisterRefs visitor.
      
      The background here is that I'd like to use this code for Breakpad
      unwind info, which uses similar syntax to describe unwind info. For
      example, a simple breakpad unwind program might look like:
          .cfa: $esp 8 + $ebp: .cfa 8 - ^
      
      To be able to do this, I need to be able to customize register
      resolving, as that is presently hardcoded to use codeview register
      names, but breakpad supports a lot more architectures with different
      register names. Moving the resolution into a separate class will allow
      each user to use a different resolution logic.
      
      Reviewers: aleksandr.urakov, zturner, amccarth
      
      Subscribers: jdoerfert, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D60068
      
      llvm-svn: 357455
      1c4ee160
    • Ilya Biryukov's avatar
      [clangd] Use capacity() instead of size() in RefSlab::bytes() · bea52e52
      Ilya Biryukov authored
      Patch by Nathan Ridge.
      
      Reviewers: gribozavr
      
      Reviewed By: gribozavr
      
      Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D60040
      
      llvm-svn: 357454
      bea52e52
    • Eric Fiselier's avatar
      Fix a number of bugs in __val_expr's subset operator[]. · 06571975
      Eric Fiselier authored
      The current definitions were entirely broken. They didn't call any
      existing constructor and the forgot to friend the expression types they
      were trying to construct.
      
      llvm-svn: 357453
      06571975
    • Hans Wennborg's avatar
      SimplifyCFG SinkCommonCodeFromPredecessors: Also sink function calls without used results (PR41259) · b669fea4
      Hans Wennborg authored
      The code was previously checking that candidates for sinking had exactly
      one use or were a store instruction (which can't have uses). This meant
      we could sink call instructions only if they had a use.
      
      That limitation seemed a bit arbitrary, so this patch changes it to
      "instruction has zero or one use" which seems more natural and removes
      the need to special-case stores.
      
      Differential revision: https://reviews.llvm.org/D59936
      
      llvm-svn: 357452
      b669fea4
    • Pavel Labath's avatar
      Simplify TestGdbRemoteRegisterState · 155bc16e
      Pavel Labath authored
      While reviewing D56233 it became clear to me that this test can be
      simplified. There's no need for a start-stop cycle in the inferior -- we
      can start fiddling with its registers as soon as it is launched.
      
      llvm-svn: 357451
      155bc16e
    • Fangrui Song's avatar
      ar_to_bc.sh: replace readlink -f with custom relative path resolution · 9d144924
      Fangrui Song authored
      llvm-ar is a crunchgen-style executable dispatching to dlltool,ranlib,lib,ar based on argv[0].
      In our content-addressable storage, readlink -f resolves paths to some
      digest and thus lost the original "llvm-ar" filename.
      
      Replace it with a custom path resolution to fix the problem.
      
      llvm-svn: 357450
      9d144924
    • Matt Davis's avatar
      [compiler-rt][test] Make instrprof-set-dir-mode test tolerant of group ID · 60a8816c
      Matt Davis authored
      Patch from 'troyj':
      Hi, I ran into a problem with this test when the source was located in
      certain directories. The mkdir(2) man page states that the set-group-ID
      bit is inherited from the parent directory, but this test was written in
      such a way that it assumes the bit is unset. Whether that assumption is
      true depends on where the checkout lives, which leads to some people
      being able to reproduce the problem whereas others cannot. I think the
      correct fix is to exclude the bit from the check.
      
      Making probinson a reviewer since they reviewed the original test.
      
      Patch landed for troyj, thanks!
      
      Differential Revision: D53832
      
      llvm-svn: 357449
      60a8816c
    • Philip Reames's avatar
      [LoopPredication] Simplify widenable condition handling [NFC] · adb3ece2
      Philip Reames authored
      The code doesn't actually need any of the information about the widenable condition at this level.  The only thing we need is to ensure the WC call is the last thing anded in, and even that is a quirk we should really look to remove.
      
      llvm-svn: 357448
      adb3ece2
    • Nick Lewycky's avatar
      Add an optional list of blocks to avoid when looking for a path in isPotentiallyReachable. · c0ebfbe3
      Nick Lewycky authored
      The leads to some ambiguous overloads, so update three callers.
      
      Differential Revision: https://reviews.llvm.org/D60085
      
      llvm-svn: 357447
      c0ebfbe3
    • Craig Topper's avatar
      [X86] Add test cases to fixup-lea.ll for optsize and no size optimization. Add... · 536383a3
      Craig Topper authored
      [X86] Add test cases to fixup-lea.ll for optsize and no size optimization. Add +/-slow-incdec command lines
      
      We only form inc/dec in FixupLEAs under minsize today, but all other locations in the compiler for inc/dec with optsize.
      
      llvm-svn: 357446
      536383a3
    • Craig Topper's avatar
      [X86] Autogenerate complete checks. NFC · c1330159
      Craig Topper authored
      llvm-svn: 357445
      c1330159