SuccessChanges

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

Summary

  1. [X86] Remove usesCustomInserter from MWAITX_SAVE_EBX and MWAITX_SAVE_RBX. NFC (details)
  2. [X86] Correct the implicit defs/uses for the MWAITX pseudo instructions. (details)
  3. [DomTree] findNearestCommonDominator: assert the nodes are in tree (details)
  4. llvm-dwarfdump: Dump address forms in their encoded length rather than always in 64 bits (details)
  5. [NFCI] Remove unnecessary trailing undef in RuntimeLibcalls.def (details)
  6. [NewPM] collapsing nested pass mangers of the same type (details)
  7. llvm-dwarfdump: Print addresses in debug_line to the parsed address size (details)
  8. [X86] Remove MWAITX_SAVE_EBX pseudo instruction. Always save/restore the full %rbx register even in gnux32. (details)
  9. llvm-dwarfdump: Add support for DW_RLE_startx_endx (details)
  10. [HIP] Add option --gpu-instrument-lib= (details)
  11. Revert "[HIP] Add option --gpu-instrument-lib=" (details)
  12. Recommit "[HIP] Add option --gpu-instrument-lib=" (details)
  13. [HIP] Fix default output file for -E (details)
  14. [HIP] Fix -fgpu-allow-device-init option (details)
  15. llvm-dwarfdump: Don't try to parse rnglist tables when dumping CUs (details)
  16. [X86] MWAITX_SAVE_RBX should not have EBX as an implicit use. (details)
  17. [lldb] [test/Register] Attempt to fix x86-fp-read.test on Darwin (details)
  18. [llvm] Rename DwarfFile to DWARFFile to fix ODR violation (NFC) (details)
  19. [RISCV][ASAN] mark asan as supported for RISCV64 and enable tests (details)
  20. [DebugInfo] Improve dbg preservation in LSR. (details)
  21. [AST][RecoveryExpr] Popagate the error-bit from a VarDecl's initializer to DeclRefExpr. (details)
  22. [TableGen][GlobalISel] add handling of nested *_SUBREG (details)
  23. [AMDGPU] Split R600 and GCN bfe patterns (details)
  24. [AMDGPU] Make bfe patterns divergence-aware (details)
Commit 0db97234cf490e464c82f2191fef2d8a163106fb by craig.topper
[X86] Remove usesCustomInserter from MWAITX_SAVE_EBX and MWAITX_SAVE_RBX. NFC

These are now emitted by a CustomInserter rather than using a custom
inserter themselves.
The file was modifiedllvm/lib/Target/X86/X86InstrCompiler.td
Commit 952dfd76c6696207cc290c4f6f15d5dea5cca795 by craig.topper
[X86] Correct the implicit defs/uses for the MWAITX pseudo instructions.

MWAITX doesn't touch EFLAGS so no pseudos should def EFLAGS.

The SAVE_EBX/RBX pseudos only needs to def the EBX register that
the expansion overwrites. The EAX and ECX registers are only read.

The pseudo emitted during isel that is used by the custom inserter
shouldn't have any implicit defs or uses since everything is in
vregs.
The file was modifiedllvm/lib/Target/X86/X86InstrCompiler.td
Commit 1065f3439bad59323f16e7c8ee568c7d94dcd952 by i
[DomTree] findNearestCommonDominator: assert the nodes are in tree

i.e. they cannot be unreachable from the entry (which usually indicate usage errors).
This change allows the removal of some nullptr checks.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D88758
The file was modifiedllvm/include/llvm/Support/GenericDomTree.h
Commit ea83e0b17ecf5dc0cf228afb334aa72ce9b5aec1 by dblaikie
llvm-dwarfdump: Dump address forms in their encoded length rather than always in 64 bits

Few places did this already - refactor them all into a common helper.
The file was modifiedllvm/test/DebugInfo/MIR/ARM/subregister-full-piece.mir
The file was modifiedllvm/test/DebugInfo/X86/debug-loc-offset.mir
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/tombstone.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
The file was modifiedllvm/test/DebugInfo/MIR/Hexagon/bundled-call-pr44001.mir
The file was modifiedllvm/test/DebugInfo/Mips/dbg-call-site-low-pc.ll
The file was modifiedllvm/test/MC/WebAssembly/debug-localvar.ll
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
The file was modifiedllvm/test/MC/ARM/dwarf-asm-single-section.s
The file was modifiedllvm/test/MC/ARM/dwarf-asm-multiple-sections-dwarf-2.s
The file was modifiedllvm/test/MC/MachO/gen-dwarf.s
The file was modifiedllvm/test/DebugInfo/X86/debug_addr.ll
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/gnu_call_site.s
The file was modifiedllvm/test/MC/ARM/dwarf-asm-nonstandard-section.s
The file was modifiedllvm/test/MC/WebAssembly/dwarfdump.ll
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
Commit 83cc498c38d2e4baaf3a233ae73fc49e24ac8898 by Yuanfang Chen
[NFCI] Remove unnecessary trailing undef in RuntimeLibcalls.def

All uses of the file undef the macro already.
The file was modifiedllvm/include/llvm/IR/RuntimeLibcalls.def
Commit 2c94d88e076990a7b533578a392a150d4b9b0fa8 by Yuanfang Chen
[NewPM] collapsing nested pass mangers of the same type

This is one of the reason for extra invalidations in D84959. In
practice, I don't think we have use cases needing this. This simplifies
the pipeline a bit and prune corner cases when considering
invalidations.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D85676
The file was modifiedllvm/test/Other/new-pm-thinlto-defaults.ll
The file was modifiedllvm/test/Other/pass-pipeline-parsing.ll
The file was modifiedllvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
The file was modifiedllvm/test/Other/new-pm-defaults.ll
The file was modifiedllvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
The file was modifiedllvm/include/llvm/IR/PassManager.h
The file was modifiedllvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
The file was modifiedclang/test/CodeGen/thinlto-distributed-newpm.ll
The file was modifiedllvm/test/Other/new-pass-manager.ll
The file was modifiedllvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
The file was modifiedllvm/test/Other/new-pm-lto-defaults.ll
Commit 628a319475dceac307add6953df028ec372e7f4e by dblaikie
llvm-dwarfdump: Print addresses in debug_line to the parsed address size
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/tombstone.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
Commit 4b38ceb0ebd7ed5fe1d5cbaf981060227515fb6e by craig.topper
[X86] Remove MWAITX_SAVE_EBX pseudo instruction. Always save/restore the full %rbx register even in gnux32.

ebx/rbx only needs to be saved when 64-bit registers are supported
anyway. It should be fine to save/restore the whole rbx register
even in gnux32 where the base is technically just ebx.

This matches what we do for cmpxchg16b where rbx is saved/restored
regardless of gnux32.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/base-pointer-and-mwaitx.ll
The file was modifiedllvm/lib/Target/X86/X86InstrCompiler.td
The file was modifiedllvm/lib/Target/X86/X86ExpandPseudo.cpp
Commit 92c45e4ee2511399484e8af26b66ba37ad0ed8e7 by dblaikie
llvm-dwarfdump: Add support for DW_RLE_startx_endx
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/debug_rnglists.s
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/tombstone.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
Commit 64f7790e7d2309b5d38949921a256acf8068e659 by Yaxun.Liu
[HIP] Add option --gpu-instrument-lib=

Add an option --gpu-instrument-lib= to allow users to specify
an instrument device library. This is for supporting -finstrument
in device code for debugging/profiling tools.

Differential Revision: https://reviews.llvm.org/D88557
The file was modifiedclang/test/Driver/hip-device-libs.hip
The file was addedclang/test/Driver/Inputs/hip_multiple_inputs/instrument.bc
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
The file was modifiedclang/include/clang/Driver/Options.td
Commit fef0ebbc0b39167656bd11283e3084b000b309dd by Yaxun.Liu
Revert "[HIP] Add option --gpu-instrument-lib="

This reverts commit 64f7790e7d2309b5d38949921a256acf8068e659 due
to regression in hip-device-libs.hip.
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
The file was removedclang/test/Driver/Inputs/hip_multiple_inputs/instrument.bc
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/hip-device-libs.hip
Commit 9756a402f297d0030689aaade3651785b7496649 by Yaxun.Liu
Recommit "[HIP] Add option --gpu-instrument-lib="

recommit 64f7790e7d2309b5d38949921a256acf8068e659 after
fixing hip-device-libs.hip.
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
The file was addedclang/test/Driver/Inputs/hip_multiple_inputs/instrument.bc
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/hip-device-libs.hip
Commit 5b551b79d3bba5a8a282bf5f72c7baaccf925870 by Yaxun.Liu
[HIP] Fix default output file for -E

By convention the default output file for -E is "-" (stdout).
This is expected by tools like ccache, which uses output
of -E to determine if a file and its dependence has changed.

Currently clang does not use stdout as default output file for -E
for HIP, which causes ccache not working.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D88730
The file was modifiedclang/lib/Driver/Driver.cpp
The file was modifiedclang/test/Driver/hip-output-file-name.hip
Commit e372c1d7624e2402a5f91a640780fb32649922b6 by Yaxun.Liu
[HIP] Fix -fgpu-allow-device-init option

The option needs to be passed to both host and device compilation.

Differential Revision: https://reviews.llvm.org/D88550
The file was modifiedclang/test/Driver/hip-options.hip
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/lib/Driver/ToolChains/HIP.cpp
Commit 6d0be74af5555f7bc56ac72cbd98ff270fd1291b by dblaikie
llvm-dwarfdump: Don't try to parse rnglist tables when dumping CUs

It's not possible to do this in complete generality - a CU using a
sec_offset DW_AT_ranges has no way of knowing where its rnglists
contribution starts, so should not attempt to parse any full rnglist
table/header to do so. And even using FORM_rnglistx there's no need to
parse the header - the offset can be computed using the CU's DWARF
format (32 or 64) to compute offset entry sizes, and then the list
parsed at that offset without ever trying to find a rnglist contribution
header immediately prior to the rnglists_base.
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/tombstone.s
The file was modifiedllvm/test/DebugInfo/X86/dwarfdump-rnglists-dwarf64.s
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
The file was modifiedllvm/test/DebugInfo/X86/dwarfdump-rnglists.s
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
Commit b18026114ab1410d531559ad6d9f1b445b98a35f by craig.topper
[X86] MWAITX_SAVE_RBX should not have EBX as an implicit use.

RBX was copied to a virtual register before this instruction
was created. And the EBX input for the final MWAITX is still
in a virtual register. So EBX isn't read by this pseudo.
The file was modifiedllvm/lib/Target/X86/X86InstrCompiler.td
Commit e8beb6988bab71ee4917288f07674b4982736109 by Jonas Devlieghere
[lldb] [test/Register] Attempt to fix x86-fp-read.test on Darwin

Darwin seems to use stmmN instead of stN. Use a regex to accept both.

Also try to actually clear st(7).

Differential revision: https://reviews.llvm.org/D88795
The file was modifiedlldb/test/Shell/Register/x86-fp-read.test
The file was modifiedlldb/test/Shell/Register/Inputs/x86-fp-read.cpp
Commit a58b20e5a4fb64404cb62d2bb6a5e6dc40d22784 by Jonas Devlieghere
[llvm] Rename DwarfFile to DWARFFile to fix ODR violation (NFC)

Rename the DwarfFile class in DWARFLinker to DWARFFile. This is
consistent with the other DWARF classes and avoids a ODR violation with
the DwarfFile class in AsmPrinter.
The file was modifiedllvm/tools/dsymutil/DwarfLinkerForBinary.cpp
The file was modifiedllvm/tools/dsymutil/DwarfLinkerForBinary.h
The file was modifiedllvm/include/llvm/DWARFLinker/DWARFLinker.h
The file was modifiedllvm/lib/DWARFLinker/DWARFLinker.cpp
Commit cf4aa68388025a731236bc6dbe113ffdfe14c6c2 by kupokupokupopo
[RISCV][ASAN] mark asan as supported for RISCV64 and enable tests

[11/11] patch series to port ASAN for riscv64

These changes allow using ASAN on RISCV64 architecture.
The majority of existing tests are passing. With few exceptions (see below).
Tests we run on qemu and on "HiFive Unleashed" board.

Tests run:

```
Asan-riscv64-inline-Test  - pass
Asan-riscv64-inline-Noinst-Test  - pass
Asan-riscv64-calls-Noinst-Test  - pass
Asan-riscv64-calls-Test  - pass
```

Lit tests:

```
RISCV64LinuxConfig (282 supported, few failures)
RISCV64LinuxDynamicConfig (289 supported, few failures)
```

Lit failures:

```
TestCases/malloc_context_size.cpp - asan works, but backtrace misses some calls
TestCases/Linux/malloc_delete_mismatch.cpp - asan works, but backtrace misses some calls
TestCases/Linux/static_tls.cpp - "Can't guess glibc version" (under debugging)
TestCases/asan_and_llvm_coverage_test.cpp - missing libclang_rt.profile-riscv64.a
```

These failures are under debugging currently and shall be addressed in a
subsequent commits.

Depends On D87581

Reviewed By: eugenis, vitalybuka

Differential Revision: https://reviews.llvm.org/D87582
The file was modifiedcompiler-rt/test/asan/CMakeLists.txt
The file was modifiedcompiler-rt/cmake/config-ix.cmake
The file was modifiedcompiler-rt/test/asan/TestCases/Linux/vfork.cpp
The file was modifiedcompiler-rt/lib/asan/tests/asan_test.cpp
The file was modifiedcompiler-rt/lib/asan/scripts/asan_symbolize.py
The file was modifiedcompiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
The file was modifiedcompiler-rt/test/asan/TestCases/Linux/ptrace.cpp
Commit a3caf7f6102dc863425f9714b099af58397f0cd2 by markus.lavin
[DebugInfo] Improve dbg preservation in LSR.

Use SCEV to salvage additional @llvm.dbg.value that have turned into
referencing undef after transformation (and traditional
salvageDebugInfo). Before transformation compute SCEV for each
@llvm.dbg.value in the loop body and store it (along side its current
DIExpression). After transformation update those @llvm.dbg.value now
referencing undef by comparing its stored SCEV to the SCEV of the
current loop-header PHI-nodes. Allow match with offset by inserting
compensation code in the DIExpression.

Fixes : PR38815

Differential Revision: https://reviews.llvm.org/D87494
The file was modifiedllvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
The file was modifiedllvm/test/DebugInfo/COFF/fpo-shrink-wrap.ll
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
The file was addedllvm/test/Transforms/LoopStrengthReduce/dbg-preserve-0.ll
Commit 3423d5c9da812b0076d1cf14e96ce453e35257b6 by hokein.wu
[AST][RecoveryExpr] Popagate the error-bit from a VarDecl's initializer to DeclRefExpr.

The error-bit was missing, if a DeclRefExpr (which refers to a VarDecl
with a contains-errors initializer).

It could cause different violations in clang -- the DeclRefExpr is value-dependent,
but not contains-errors, `ABC<DeclRefExpr>` could produce a non-error
and non-dependent type in non-template context, which will lead to
crashes in constexpr evaluation.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D86048
The file was modifiedclang/lib/AST/ComputeDependence.cpp
The file was modifiedclang/test/Sema/invalid-member.cpp
Commit 64b879ae2a8a4a4e541404c19d96d18c4aed810e by mikael.holmen
[TableGen][GlobalISel] add handling of nested *_SUBREG

When nesting INSERT_SUBREG and EXTRACT_SUBREG, GlobalISelEmitter would
fail to find the register class of the nested node. This patch fixes
that for registers with subregs.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D88487
The file was addedllvm/test/TableGen/GlobalISelEmitter-nested-subregs.td
The file was modifiedllvm/utils/TableGen/GlobalISelEmitter.cpp
Commit 0d5989bb24934802a9e6fcca63848a57a91efcc8 by jay.foad
[AMDGPU] Split R600 and GCN bfe patterns

This is in preparation for making the GCN patterns divergence-aware.
NFC.

Differential Revision: https://reviews.llvm.org/D88579
The file was modifiedllvm/lib/Target/AMDGPU/EvergreenInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstructions.td
Commit 16778b19f2c2756a9e0dd04636fb2c269f684917 by jay.foad
[AMDGPU] Make bfe patterns divergence-aware

This tends to increase code size but more importantly it reduces vgpr
usage, and could avoid costly readfirstlanes if the result needs to be
in an sgpr.

Differential Revision: https://reviews.llvm.org/D88580
The file was modifiedllvm/test/CodeGen/AMDGPU/amdgpu.private-memory.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.ubfe.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/bfe-patterns.ll