1. Nov 25, 2019
    • Jeremy Morse's avatar
      [DebugInfo] Avoid register coalesing unsoundly changing DBG_VALUE locations · d9c9a4e4
      Jeremy Morse authored
      This is a re-land of D56151 / r364515 with a completely new implementation.
      
      Once MIR code leaves SSA form and the liveness of a vreg is considered,
      DBG_VALUE insts are able to refer to non-live vregs, because their
      debug-uses do not contribute to liveness. This non-liveness becomes
      problematic for optimizations like register coalescing, as they can't
      ``see'' the debug uses in the liveness analyses.
      
      As a result registers get coalesced regardless of debug uses, and that can
      lead to invalid variable locations containing unexpected values. In the
      added test case, the first vreg operand of ADD32rr is merged with various
      copies of the vreg (great for performance), but a DBG_VALUE of the
      unmodified operand is blindly updated to the modified operand. This changes
      what value the variable will appear to have in a debugger.
      
      Fix this by changing any DBG_VALUE whose operand will be resurrected by
      register coalescing to be a $noreg DBG_VALUE, i.e. give the variable no
      location. This is an overapproximation as some coalesced locations are safe
      (others are not) -- an extra domination analysis would be required to work
      out which, and it would be better if we just don't generate non-live
      DBG_VALUEs.
      
      Differential Revision: https://reviews.llvm.org/D64630
      d9c9a4e4
    • Raphael Isemann's avatar
      [lldb] Remove lldb's own ASTDumper · 7a6588ab
      Raphael Isemann authored
      Summary:
      LLDB's ASTDumper is just a clone of Clang's ASTDumper but with some scary code and
      some unrelated functionality (like dumping name/attributes of types). This removes LLDB's ASTDumper
      and replaces its uses with the `ClangUtils::DumpDecl` method that just calls Clang's ASTDumper
      and returns the result as a string.
      
      The few uses where we just want a textual representation of a type (which will print their name/attributes but not
      dump any AST) are now also in ClangUtil under a `ToString` name until we find a better home for them.
      
      Reviewers: labath
      
      Reviewed By: labath
      
      Subscribers: mgorny, JDevlieghere, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D70663
      7a6588ab
    • Anna Welker's avatar
      [ARM][MVE] Select vqneg · 6fc3e6f2
      Anna Welker authored
      Adds a pattern to ARMInstrMVE.td to use a VQNEG
        instruction if an equivalent multi-instruction
        construct is found.
      
      Differential Revision: https://reviews.llvm.org/D70491
      6fc3e6f2
    • OCHyams's avatar
      [DebugInfo@O2][Utils] Undef instead of delete dbg.values in helper func · 2de23c83
      OCHyams authored
      Summary:
      Related bug: https://bugs.llvm.org/show_bug.cgi?id=40648
      
      Static helper function rewriteDebugUsers in Local.cpp deletes dbg.value
      intrinsics when it cannot move or rewrite them, or salvage the deleted
      instruction's value. It should instead undef them in this case.
      
      This patch fixes that and I've added a test which covers the failing test
      case in bz40648. I've updated the unit test Local.ReplaceAllDbgUsesWith
      to check for this behaviour (and fixed a typo in the test which would
      cause the old test to always pass).
      
      Reviewers: aprantl, vsk, djtodoro, probinson
      
      Reviewed By: vsk
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #debug-info, #llvm
      
      Differential Revision: https://reviews.llvm.org/D70604
      2de23c83
    • serge_sans_paille's avatar
      [AVR] Fix endianness handling in AVR MC · 29b4d8f1
      serge_sans_paille authored
      Differential Revision: https://reviews.llvm.org/D67926
      29b4d8f1
    • Georgii Rymar's avatar
      [yaml2obj/obj2yaml] - Add support for SHT_LLVM_DEPENDENT_LIBRARIES sections. · 9659464d
      Georgii Rymar authored
      This section contains strings specifying libraries to be added to the link by the linker.
      The strings are encoded as standard null-terminated UTF-8 strings.
      
      This patch adds a way to describe and dump SHT_LLVM_DEPENDENT_LIBRARIES sections.
      
      I introduced a new YAMLFlowString type here. That used to teach obj2yaml to dump
      them like:
      
      ```
      Libraries: [ foo, bar ]
      ```
      
      instead of the following (if StringRef would be used):
      
      ```
      Libraries:
        - foo
        - bar
      ```
      
      Differential revision: https://reviews.llvm.org/D70598
      9659464d
    • Kadir Cetinkaya's avatar
      [clangd] Fix diagnostic location for macro expansions · e841029a
      Kadir Cetinkaya authored
      Summary:
      Diagnostic locations were broken when it was result of a macro
      expansion. This patch fixes it by using expansion location instead of location
      inside macro body.
      
      Fixes https://github.com/clangd/clangd/issues/201.
      
      Reviewers: hokein
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70494
      e841029a
    • Kadir Cetinkaya's avatar
      [clangd] Improve symbol qualification in DefineInline code action · 5075c682
      Kadir Cetinkaya authored
      Summary:
      Currently define inline action fully qualifies any names in the
      function body, which is not optimal and definitely natural.
      
      This patch tries to improve the situation by dropping any name
      specifiers shared by function and names spelled in the body. For example
      if you are moving definition of a function in namespace clang::clangd,
      and body has any decl's coming from clang or clang::clangd namespace,
      those qualifications won't be added since they are redundant.
      
      It also drops any qualifiers that are visible in target context.
      
      Reviewers: ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69033
      5075c682
    • Kadir Cetinkaya's avatar
      [clangd] Helper for getting nested namespace qualification · 97d6e8e0
      Kadir Cetinkaya authored
      Summary:
      Introduce a new helper for getting minimally required qualifiers
      necessary to spell a name at a point in a given DeclContext. Currently takes
      using directives and nested namespecifier of DeclContext itself into account.
      
      Initially will be used in define inline and outline actions.
      
      Reviewers: ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69608
      97d6e8e0
    • Pavel Labath's avatar
      [lldb-vscode] Fix a race in test_extra_launch_commands · aa16bf15
      Pavel Labath authored
      Summary:
      The test used a non-stopping "run" command to launch the process. This
      is different from the regular launch with no extra launch commands,
      which uses eLaunchFlagStopAtEntry to ensure that the process stops
      straight away.
      
      I'm not really sure what's supposed to happen in non-stop-at-entry mode,
      or if that's even supported, but what ended up happening was the launch
      packet got a reply while the process was running. Then the test case did
      a continue_to_next_stop(), which queued a *second* resume request
      (along with the internal "resumes" which were being issued as a part of
      normal process startup). These two resumes ended up chasing each other's
      tails inside lldb in a way which produced hilarious log traces.
      Surprisingly, the test ended up passing most of the time, but it did
      cause spurious failures when the test seemed to miss a breakpoint.
      
      This changes the test to use stop-at-entry mode in the manual launch
      sequence too, which seems to be enough to make the test pass reliably.
      
      Reviewers: clayborg, kusmour, jankratochvil
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D70127
      aa16bf15
    • QingShan Zhang's avatar
    • Craig Topper's avatar
    • czhengsz's avatar
      Revert "[PowerPC] combine rlwinm+rlwinm to rlwinm" · d1c16598
      czhengsz authored
      This reverts commit 29f6f9b2.
      d1c16598
    • Seiya Nuta's avatar
      [llvm-objcopy][MachO] Implement --dump-section · d72a8a4d
      Seiya Nuta authored
      Reviewers: alexshap, rupprecht, jhenderson
      
      Reviewed By: alexshap, rupprecht, jhenderson
      
      Subscribers: MaskRay, jakehehrlich, abrachet, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66408
      d72a8a4d
    • Petr Hosek's avatar
      [CMake] Use correct include path for InstrProfData.inc on Darwin · e8a4e589
      Petr Hosek authored
      On Darwin, part of the profile runtime is included in the builtin
      library. f35032e0 changed the location of InstrProfData.inc but the
      builtin build for Darwin hasn't been updated to include the new
      path which causes a breakage when building for Darwin. This change
      addresses this breakage.
      e8a4e589
    • Florian Hahn's avatar
      Recommit f0c2a5af "[LV] Generalize conditions for sinking instrs for first order recurrences." · 9d24933f
      Florian Hahn authored
      This version contains 2 fixes for reported issues:
      1. Make sure we do not try to sink terminator instructions.
      2. Make sure we bail out, if we try to sink an instruction that needs to
         stay in place for another recurrence.
      
      Original message:
      If the recurrence PHI node has a single user, we can sink any
      instruction without side effects, given that all users are dominated by
      the instruction computing the incoming value of the next iteration
      ('Previous'). We can sink instructions that may cause traps, because
      that only causes the trap to occur later, but not on any new paths.
      
      With the relaxed check, we also have to make sure that we do not have a
      direct cycle (meaning PHI user == 'Previous), which indicates a
      reduction relation, which potentially gets missed by
      ReductionDescriptor.
      
      As follow-ups, we can also sink stores, iff they do not alias with
      other instructions we move them across and we could also support sinking
      chains of instructions and multiple users of the PHI.
      
      Fixes PR43398.
      
      Reviewers: hsaito, dcaballe, Ayal, rengolin
      
      Reviewed By: Ayal
      
      Differential Revision: https://reviews.llvm.org/D69228
      9d24933f
    • Simon Atanasyan's avatar
      1de788a1
    • Florian Hahn's avatar
      [LoopInterchange] Adjust assertions when updating successors. · 9a432161
      Florian Hahn authored
      Currently the assertion in updateSuccessor is overly strict in some
      cases and overly relaxed in other cases. For branches to the inner and
      outer loop preheader it is too strict, because they can either be
      unconditional branches or conditional branches with duplicate targets.
      Both cases are fine and we can allow updating multiple successors.
      
      On the other hand, we have to at least update one successor. This patch
      adds such an assertion.
      9a432161
    • Dávid Bolvanský's avatar
    • Dávid Bolvanský's avatar
      [Diagnostics] Warn for comparison with string literals expanded from macro (PR44064) · ba401767
      Dávid Bolvanský authored
      Summary:
      As noted in PR, we have a poor test coverage for this warning. I think macro support was just overlooked. GCC warns in these cases.
      Clang missed a real bug in the code I am working with, GCC caught it.
      
      Reviewers: aaron.ballman
      
      Reviewed By: aaron.ballman
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D70624
      ba401767
  2. Nov 24, 2019