SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [CGSCC] Detect devirtualization in more cases (details)
  2. DebugInfo: Hash DIE referevences (DW_OP_convert) when computing Split DWARF signatures (details)
  3. [IR] Merge metadata manipulation code into Value (details)
  4. [lldb] Fix missing initialization in UtilityFunction ctor (NFC) (details)
  5. [runtimes] Do not set XXX_STANDALONE_BUILD for libc++/abi/unwind (details)
  6. [lldb] Fix bug instroduced by a00acbab45b0 (details)
  7. [SCEV][NFC] Cache symbolic max exit count (details)
  8. [JITLink][ELF] Add support for ELF::R_X86_64_REX_GOTPCRELX relocation. (details)
  9. Revert "[JITLink][ELF] Add support for ELF::R_X86_64_REX_GOTPCRELX relocation." (details)
  10. [llvm-objcopy][NFC] Extract arg parsing logic into a helper function (details)
  11. [DebugInfo] Clear subreg in setDebugValueUndef() (details)
  12. [ARM][SchedModels] Let ldm* instruction scheduling use MCSchedPredicate (details)
  13. [llvm-mca] Add test for cortex-a57 NEON instructions (details)
  14. [SVE]Clarify TypeSize comparisons in llvm/lib/Transforms (details)
  15. [AMDGPU] Add simplification/combines for llvm.amdgcn.fmul.legacy (details)
Commit 3024fe5b55ed72633915f613bd5e2826583c396f by aeubanks
[CGSCC] Detect devirtualization in more cases

The devirtualization wrapper misses cases where if it wraps a pass
manager, an individual pass may devirtualize an indirect call created by
a previous pass. For example, inlining may create a new indirect call
which is devirtualized by instcombine. Currently the devirtualization
wrapper will not see that because it only checks cgscc edges at the very
beginning and end of the pass (manager) it wraps.

This fixes some tests testing this exact behavior in the legacy PM.

This piggybacks off of updateCGAndAnalysisManagerForPass()'s detection
of promoted ref to call edges.

This supercedes one of the previous mechanisms to detect
devirtualization by keeping track of potentially promoted call
instructions via WeakTrackingVHs.

There is one more existing way of detecting devirtualization, by
checking if the number of indirect calls has decreased and the number of
direct calls has increased in a function. It handles cases where calls
to functions without definitions are promoted, and some tests rely on
that. LazyCallGraph doesn't track edges to functions without
definitions so this part can't be removed in this change.

check-llvm and check-clang with -abort-on-max-devirt-iterations-reached
on by default doesn't show any failures outside of tests specifically
testing it so it doesn't needlessly rerun passes more than necessary.
(The NPM -O2/3 pipeline run the inliner/function simplification pipeline
under a devirtualization repeater pass up to 4 times by default).

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D89587
The file was addedllvm/test/Transforms/Inline/devirtualize-5.ll
The file was modifiedllvm/test/Transforms/Inline/devirtualize.ll
The file was modifiedllvm/lib/Analysis/CGSCCPassManager.cpp
The file was modifiedllvm/test/Transforms/Inline/devirtualize-3.ll
The file was modifiedllvm/include/llvm/Analysis/CGSCCPassManager.h
Commit 4437df8eedfdaa11b445c34fc3b19a1b14cb3d93 by dblaikie
DebugInfo: Hash DIE referevences (DW_OP_convert) when computing Split DWARF signatures
The file was modifiedllvm/include/llvm/CodeGen/DIE.h
The file was modifiedllvm/test/DebugInfo/X86/convert-debugloc.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DIEHash.h
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DIEHash.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Commit 7975b8c38da2f46f8d88c14d24259af28805dbf3 by sepavloff
[IR] Merge metadata manipulation code into Value

Now there are two main classes in Value hierarchy, which support metadata,
these are Instruction and GlobalObject. They implement different APIs for
metadata manipulation, which however overlap. This change moves metadata
manipulation code into Value, so descendant classes can use this code for
their operations on metadata.

No functional changes intended.

Differential Revision: https://reviews.llvm.org/D67626
The file was modifiedllvm/include/llvm/IR/GlobalObject.h
The file was modifiedllvm/lib/IR/LLVMContextImpl.h
The file was modifiedllvm/lib/IR/Value.cpp
The file was modifiedllvm/include/llvm/IR/Instruction.h
The file was modifiedllvm/lib/IR/LLVMContextImpl.cpp
The file was modifiedllvm/lib/IR/Metadata.cpp
The file was modifiedllvm/include/llvm/IR/Value.h
The file was modifiedllvm/lib/IR/Core.cpp
The file was modifiedllvm/lib/IR/Instruction.cpp
Commit a00acbab45b0c407da05bf5c8152018e1857a1f0 by Jonas Devlieghere
[lldb] Fix missing initialization in UtilityFunction ctor (NFC)

The UtilityFunction ctor was dropping the text argument. Probably for
that reason ClangUtilityFunction was setting the parent's member
directly instead of deferring to the parent ctor. Also change the
signatures to take strings which are std::moved in place.
The file was modifiedlldb/include/lldb/Expression/UtilityFunction.h
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
The file was modifiedlldb/source/Expression/UtilityFunction.cpp
Commit 2b9b7b5775a1d8fcd7aa5abaa8fc0bc303434f1a by Louis Dionne
[runtimes] Do not set XXX_STANDALONE_BUILD for libc++/abi/unwind

The runtimes build was lying to the various runtimes builds by setting
XXX_STANDALONE_BUILD=ON when they are really not being built standalone.
Only COMPILER_RT_STANDALONE_BUILD appears to be necessary, but setting it
for the other runtimes actually breaks everything.

Differential Revision: https://reviews.llvm.org/D90005
The file was modifiedllvm/runtimes/CMakeLists.txt
Commit 3590a8319a5fb491cba2349509910c2479f49a00 by Jonas Devlieghere
[lldb] Fix bug instroduced by a00acbab45b0

g_expression_prefix, as the name implies, must be perfixed, not
suffixed.
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
Commit 6e574abf617c504f78f45534bcda65e95787899d by mkazantsev
[SCEV][NFC] Cache symbolic max exit count

We want to have a caching version of symbolic BE exit count
rather than recompute it every time we need it.

Differential Revision: https://reviews.llvm.org/D89954
Reviewed By: nikic, efriedma
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit e2fceec2fd15b7b74617816ddd87f456c42bbc45 by Lang Hames
[JITLink][ELF] Add support for ELF::R_X86_64_REX_GOTPCRELX relocation.

No support for relaxation yet -- this will always use the GOT entry.
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
The file was modifiedllvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_relocations.s
Commit 0f910387e610d6c3e0008da5f5305d42c546cb8c by Lang Hames
Revert "[JITLink][ELF] Add support for ELF::R_X86_64_REX_GOTPCRELX relocation."

This reverts commit e2fceec2fd15b7b74617816ddd87f456c42bbc45.

This commit broke one of the bots. Reverting while I investigate.
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
The file was modifiedllvm/test/ExecutionEngine/JITLink/X86/ELF_x86-64_relocations.s
Commit 310a8e1d1284096fd42499c48a19899ff8b150ee by alexshap
[llvm-objcopy][NFC] Extract arg parsing logic into a helper function

This diff refactors the code which determines the tool type based on
how llvm-objcopy is invoked (objcopy vs strip vs bitcode-strip vs install-name-tool).
NFC.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D89713
The file was modifiedllvm/tools/llvm-objcopy/llvm-objcopy.cpp
Commit 13edfcc97d29574d1d38ded4fa9c2af6e6519472 by david.stenberg
[DebugInfo] Clear subreg in setDebugValueUndef()

When switching the register debug operands to $noreg in
setupDebugValueUndef() also clear the sub-register indices for virtual
registers. This is done when marking DBG_VALUEs undef in other cases,
e.g. in LiveDebugVariables. I have not found any cases where leaving the
sub-register index causes any issues, and the indices would eventually
get dropped when LiveDebugVariables reinserted the undef DBG_VALUEs
after register scheduling, but if nothing else it looked a bit weird in
printouts to have sub-register indices on $noreg, and I don't think the
sub-register index holds any meaningful information at that point.

I have not been able to find any source-level reproducer for this with
an upstream target, so I have just added an instrumented machine-sink
test.

Reviewed By: djtodoro, jmorse

Differential Revision: https://reviews.llvm.org/D89941
The file was addedllvm/test/DebugInfo/MIR/X86/machinesink-subreg.mir
The file was modifiedllvm/include/llvm/CodeGen/MachineInstr.h
Commit 7a78073be7649d9d2a83df50db9ec41b9a26d4f4 by eleviant
[ARM][SchedModels] Let ldm* instruction scheduling use MCSchedPredicate

Differential revision: https://reviews.llvm.org/D89957
The file was modifiedllvm/test/tools/llvm-mca/ARM/cortex-a57-memory-instructions.s
The file was modifiedllvm/lib/Target/ARM/ARMSchedule.td
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
The file was modifiedllvm/lib/Target/ARM/ARMScheduleA57.td
The file was modifiedllvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h
The file was modifiedllvm/test/tools/llvm-mca/ARM/cortex-a57-basic-instructions.s
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.h
Commit ffc0f577dac7097facc6b3e254c0ff73a723738f by eleviant
[llvm-mca] Add test for cortex-a57 NEON instructions
The file was addedllvm/test/tools/llvm-mca/ARM/cortex-a57-neon-instructions.s
Commit 241563647555e48cfa96146dd19d00e5aadbc518 by caroline.concatto
[SVE]Clarify TypeSize comparisons in llvm/lib/Transforms

Use isKnownXY comparators when one of the operands can be with
scalable vectors or getFixedSize() for all the other cases.

This patch also does bug fixes for getPrimitiveSizeInBits by using
getFixedSize() near the places with the TypeSize comparison.

Differential Revision: https://reviews.llvm.org/D89703
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
The file was modifiedllvm/lib/Transforms/Scalar/NaryReassociate.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopPredication.cpp
The file was modifiedllvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
Commit 86a480e9ce786bc55c1c9632d9a42c08846e4695 by jay.foad
[AMDGPU] Add simplification/combines for llvm.amdgcn.fmul.legacy

Differential Revision: https://reviews.llvm.org/D88955
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
The file was modifiedllvm/include/llvm/IR/PatternMatch.h
The file was addedllvm/test/Transforms/InstCombine/AMDGPU/fmul_legacy.ll