SuccessChanges

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

Summary

  1. [MCAsmInfo] Support UsesCFIForDebug for targets with no exception handling (details)
  2. [AArch64] Deleted unused AsmBackend functions (details)
  3. [tests] Update Transforms/FunctionAttrs/nosync.ll (details)
  4. [mlir] Check generated IR of math_polynomial_approx.mlir (details)
  5. [flang] Provide access to constant character array data (details)
  6. [WebAssembly] Fix JS code mentions in LowerEmscriptenEHSjLj (details)
  7. [M68k][test] Initial migration of MC tests (details)
  8. [M68k][AsmParser] Support negative integer constants (details)
  9. [M68k][AsmParser] Fix invalid register name parsing logics (details)
  10. [dfsan] extend a test case to measure origin memory usage (details)
  11. [ARM] Simplification to ARMBlockPlacement Pass. (details)
  12. [AMDGPU] Revise handling of preexisting waitcnt (details)
  13. [InstCombine] Fully disable select to and/or i1 folding (details)
  14. [test] Delete redundant arm64-tls-relocs.s (details)
  15. [AArch64] Replace fixup_aarch64_tlsdesc_call with FirstLiteralRelocationKind + R_AARCH64_{,P32_}TLSDESC_CALL (details)
  16. [M68k][test][NFC] Scrubing some tests (details)
  17. [AMDGPU] Move insertion of function entry waitcnt later (details)
  18. [AMDGPU] Switch AnnotateUniformValues to MemorySSA (details)
  19. [scudo] Add initialization for TSDRegistrySharedT (details)
  20. [ORC] Introduce C API for adding object buffers directly to an object layer. (details)
  21. [OpenMP] Fix non-determinism in clang copyin codegen (details)
  22. [ORC] Add missing library dependency on IRReader. (details)
  23. [BPF][Test] Disable codegen test on AIX (details)
  24. [SelectionDAG][Mips][PowerPC][RISCV][WebAssembly] Teach computeKnownBits/ComputeNumSignBits about atomics (details)
  25. [OpenMP][NFC] Refactor Clang OpenMP tests using update_cc_test_checks (details)
  26. [clangd] Check if macro is already in the IdentifierTable before loading it (details)
  27. [MLIR][GPU][NVVM] Add warp synchronous matrix-multiply accumulate ops (details)
  28. [OpenMP] Make sure classes work on the device as they do on the host (details)
  29. [OpenMP] Ensure the DefaultMapperId has a location (details)
  30. [OpenMP] Overhaul `declare target` handling (details)
  31. [llvm][NFC] Remove deprecated Alignment::None() (details)
  32. [llvm][NFC] Remove deprecated DataLayout::getPreferredAlignment functions (details)
  33. [llvm][NFC] Remove deprecated InterleaveGroup::getAlignment() function. (details)
  34. [llvm][NFC] Remove SelectionDag alignment deprecated functions (details)
  35. [llvm][NFC] Remove CallingConvLower deprecated alignment functions (details)
  36. [llvm-objdump] Use std::make_unique (details)
  37. [lit] Report tool path from use_llvm_tool if found via env variable (details)
  38. [ARM] Transforming memcpy to Tail predicated Loop (details)
  39. [flang] Remove `%f18` from LIT configuration files (details)
  40. [AMDGPU] SIFoldOperands: clean up tryConstantFoldOp (details)
  41. [clang-format] Add more support for C# 8 nullables (details)
  42. [clang-format] Fix C# nullable-related errors (details)
  43. [clang-format] Rename common types between C#/JS (details)
Commit 41f8b8e8075bfb80037390ff033558565f656007 by VenkataRamanaiah.Nalamothu
[MCAsmInfo] Support UsesCFIForDebug for targets with no exception handling

This change enables emitting CFI unwind information for debugging purpose
for targets with MCAsmInfo::ExceptionsType == ExceptionHandling::None.

Currently generating CFI unwind information is entangled with supporting
the exceptions, even when AsmPrinter explicitly recognizes that the unwind
tables are being generated as debug information.

In fact, the unwind information is not generated even if we specify
--force-dwarf-frame-section, unless exceptions are enabled. The LIT test
llvm/test/CodeGen/AMDGPU/debug_frame.ll demonstrates this behavior.

Enable this option for AMDGPU to prepare for future patches which add
complete CFI support.

Reviewed By: dblaikie, MaskRay

Differential Revision: https://reviews.llvm.org/D78778
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
The file was modifiedllvm/include/llvm/CodeGen/AsmPrinter.h
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp
The file was addedllvm/test/DebugInfo/AMDGPU/cfi.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/split-arg-dbg-value.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/ptr-arg-dbg-value.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
The file was modifiedllvm/include/llvm/MC/MCAsmInfo.h
The file was modifiedllvm/test/CodeGen/AMDGPU/debug_frame.ll
The file was addedllvm/test/MC/ELF/AMDGPU/cfi.s
The file was addedllvm/test/MC/ELF/AMDGPU/lit.local.cfg
Commit d738ac6e12ac90f0254febb45f7b79d2dc5357e8 by i
[AArch64] Deleted unused AsmBackend functions
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
Commit 6adcdd26139c6afcc79073fe16e72e94394c607d by nhaehnle
[tests] Update Transforms/FunctionAttrs/nosync.ll

Commit generated by running update_test_checks.py, to reflect the fact
that we now add the `mustprogress` attribute.
The file was modifiedllvm/test/Transforms/FunctionAttrs/nosync.ll
Commit 3c952ab25fb8602d756d303ed498f890b922e0c6 by ezhulenev
[mlir] Check generated IR of math_polynomial_approx.mlir

Instead of just checking that we emit something.

Differential Revision: https://reviews.llvm.org/D101940
The file was modifiedmlir/test/Dialect/Math/polynomial-approximation.mlir
Commit 535cbe02a4543ca930e79c10b5d334580428e607 by pklausler
[flang] Provide access to constant character array data

Allow direct access to constant character array data (for creating a hash ID of a constant).

Differential Revision: https://reviews.llvm.org/D101208
The file was modifiedflang/include/flang/Evaluate/constant.h
Commit 7f06cae1c19da91013df2ece641ba7b4980f8c33 by aheejin
[WebAssembly] Fix JS code mentions in LowerEmscriptenEHSjLj

- Removes the mention of fastcomp, which is deprecated.
- Some functions in Emscripten have moved from JS glue code to
  compiler-rt/emscripten_setjmp.c and
  compiler-rt/emscripten_exception_builtins.c. This fixes comments about
  that.

Reviewed By: sbc100

Differential Revision: https://reviews.llvm.org/D101812
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
Commit 34da083a8c6bb42def881c8959e04c1de1366d70 by minyihh
[M68k][test] Initial migration of MC tests

As the context depicted by bug 49865[1], we are migrating tests under
`test/CodeGen/M68k/Encoding`, which was originally used to test
instruction encoding using MIR file as input, into `test/MC/M68k`. We
are also adding test directives for AsmParser using the same set of
inputs.

Currently we are converting the original MIR test files into assembly
code as well as translating the original LIT "RUN" statement into one
that only uses built-in LLVM tools (i.e. Get rid of `extract-section`).

However, since AsmParser has not completely finished, many of these
original test cases fail. Thus, this patch only migrate test files
that are passed by the current implementation of AsmParser (and
MCCodeEmitter). The remaining tests (under test/CodeGen/M68k/Encoding)
will be ported alone with the patch that fixes the related issues.

[1]: https://bugs.llvm.org/show_bug.cgi?id=49865

Differential Revision: https://reviews.llvm.org/D101410
The file was removedllvm/test/CodeGen/M68k/Encoding/Relocations/data-pc-rel.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Control/Classes/MxNOP.mir
The file was addedllvm/test/MC/M68k/Arith/Classes/MxExt.s
The file was addedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_RFRI.s
The file was addedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_RFRR_EAd.s
The file was addedllvm/test/MC/M68k/Control/Classes/MxJMP.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Bits/Classes/MxBTST_RR.mir
The file was addedllvm/test/MC/M68k/ShiftRotate/Classes/MxSR_DI.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxCMP_RR.mir
The file was addedllvm/test/MC/M68k/Arith/Classes/MxDiMu.s
The file was addedllvm/test/MC/M68k/Bits/Classes/MxBTST_RR.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Relocations/data-abs.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxExt.mir
The file was addedllvm/test/MC/M68k/Arith/Classes/MxNEG.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Control/Classes/MxRTS.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Bits/Classes/MxBTST_RI.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Relocations/data-gotpcrel.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Control/Classes/MxJMP.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxCMP_RI.mir
The file was addedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_RFRRF.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_RFRR_EAd.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/ShiftRotate/Classes/MxSR_DI.mir
The file was addedllvm/test/MC/M68k/Relocations/data-abs.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_RFRRF.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Relocations/data-gotoff.mir
The file was addedllvm/test/MC/M68k/Control/Classes/MxRTS.s
The file was addedllvm/test/MC/M68k/Relocations/data-pc-rel.s
The file was addedllvm/test/MC/M68k/Control/Classes/MxNOP.s
The file was addedllvm/test/MC/M68k/Relocations/text-plt.s
The file was addedllvm/test/MC/M68k/ShiftRotate/Classes/MxSR_DD.s
The file was addedllvm/test/MC/M68k/Arith/Classes/MxCMP_RR.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxNEG.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Data/Classes/MxMove_RI.mir
The file was addedllvm/test/MC/M68k/Arith/Classes/MxCMP_RI.s
The file was addedllvm/test/MC/M68k/Relocations/data-gotoff.s
The file was addedllvm/test/MC/M68k/Relocations/data-gotpcrel.s
The file was removedllvm/test/CodeGen/M68k/Encoding/ShiftRotate/Classes/MxSR_DD.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_RFRI.mir
The file was addedllvm/test/MC/M68k/Bits/Classes/MxBTST_RI.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Relocations/text-plt.mir
The file was addedllvm/test/MC/M68k/Data/Classes/MxMove_RI.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxDiMu.mir
Commit abac6023bba555ee930762f08a01f33370308c68 by minyihh
[M68k][AsmParser] Support negative integer constants

Parsing negative integer constants as expressions.

Differential Revision: https://reviews.llvm.org/D101732
The file was addedllvm/test/MC/M68k/Data/Classes/MxMove_MI.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Bits/Classes/MxBTST_MI.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Data/Classes/MxMove_MI.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_FMI.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Control/Classes/MxScc.mir
The file was removedllvm/test/CodeGen/M68k/Encoding/Data/Classes/MxLEA.mir
The file was modifiedllvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
The file was addedllvm/test/MC/M68k/Control/Classes/MxScc.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_FMR.mir
The file was addedllvm/test/MC/M68k/Data/Classes/MxLEA.s
The file was addedllvm/test/MC/M68k/Bits/Classes/MxBTST_MI.s
The file was addedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_FMI.s
The file was addedllvm/test/MC/M68k/Bits/Classes/MxBTST_MR.s
The file was addedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_FMR.s
The file was removedllvm/test/CodeGen/M68k/Encoding/Bits/Classes/MxBTST_MR.mir
Commit 5b3dd2a49035445dcfdb09fb7e890b79adf6ab6f by minyihh
[M68k][AsmParser] Fix invalid register name parsing logics

Adjust sanity check in register parsing function to allow register
name with more than 2 characters (e.g. ccr).

Differential Revision: https://reviews.llvm.org/D101733
The file was modifiedllvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
The file was removedllvm/test/CodeGen/M68k/Encoding/Data/Classes/MxMoveCCR.mir
The file was addedllvm/test/MC/M68k/Data/Classes/MxMoveCCR.s
Commit f3e3a1d79eee878bb2816ded1a007e71a4fca7e1 by jianzhouzh
 [dfsan] extend a test case to measure origin memory usage

This is to support D101204.

Reviewed By: gbalats

Differential Revision: https://reviews.llvm.org/D101877
The file was modifiedcompiler-rt/test/dfsan/release_shadow_space.c
Commit 9ba5238c28daf930df3dcb9bc90b5c8531ae1466 by malhar.jajoo
[ARM] Simplification to ARMBlockPlacement Pass.

It simplifies the logic by moving the predecessor  (preHeader or it's predecessor) above the target (or loopExit),
instead of moving the target to after the predecessor.

Since the loopExit is no longer being moved, directions of any branches within/to it are unaffected.

While the predecessor is being moved, the backwards movement simplifies some considerations,
and the only consideration now required is that a forward WLS to the predecessor should not become backwards.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D100094
The file was modifiedllvm/test/CodeGen/Thumb2/block-placement.mir
The file was modifiedllvm/test/CodeGen/Thumb2/mve-float32regloops.ll
The file was modifiedllvm/lib/Target/ARM/ARMBlockPlacement.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-float16regloops.ll
Commit f5199d7ae0edf47c41d7347aad18f893ad20f0b3 by Austin.Kerbow
[AMDGPU] Revise handling of preexisting waitcnt

Preexisting waitcnt may not update the scoreboard if the instruction
being examined needed to wait on fewer counters than what was encoded in
the old waitcnt instruction. Fixing this results in the elimination of
some redudnat waitcnt.

These changes also enable combining consecutive waitcnt into a single
S_WAITCNT or S_WAITCNT_VSCNT instruction.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D100281
The file was addedllvm/test/CodeGen/AMDGPU/waitcnt-preexisting-vscnt.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.gws.barrier.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
The file was modifiedllvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
The file was modifiedllvm/test/CodeGen/AMDGPU/flat-scratch.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/memory-legalizer-flat-agent.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/atomicrmw-nand.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/flat-scratch.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/waitcnt-preexisting.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/fp64-atomics-gfx90a.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/memory-legalizer-flat-system.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/memory-legalizer-flat-workgroup.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/waitcnt-debug.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/memory-legalizer-flat-volatile.ll
Commit 8a156d1c2795189389fadbf33702384f522f2506 by aqjune
[InstCombine] Fully disable select to and/or i1 folding

This is a patch that disables the poison-unsafe select -> and/or i1 folding.

It has been blocking D72396 and also has been the source of a few miscompilations
described in llvm.org/pr49688 .
D99674 conditionally blocked this folding and successfully fixed the latter one.
The former one was still blocked, and this patch addresses it.

Note that a few test functions that has `_logical` suffix are now deoptimized.
These are created by @nikic to check the impact of disabling this optimization
by copying existing original functions and replacing and/or with select.

I can see that most of these are poison-unsafe; they can be revived by introducing
freeze instruction. I left comments at fcmp + select optimizations (or-fcmp.ll, and-fcmp.ll)
because I think they are good targets for freeze fix.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101191
The file was modifiedllvm/test/Transforms/InstCombine/and2.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/reduction-inloop.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-and-or.ll
The file was modifiedllvm/test/Transforms/InstCombine/sign-test-and-or.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
The file was modifiedllvm/test/Transforms/InstCombine/dont-distribute-phi.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-cmp-br.ll
The file was modifiedllvm/test/Transforms/PhaseOrdering/unsigned-multiply-overflow-check.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-safe-impliedcond-transforms.ll
The file was modifiedllvm/test/Transforms/InstCombine/div-by-0-guard-before-umul_ov.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-safe-bool-transforms.ll
The file was modifiedllvm/test/Transforms/PGOProfile/chr.ll
The file was modifiedclang/test/CodeGenOpenCL/amdgpu-nullptr.cl
The file was modifiedllvm/test/Transforms/InstCombine/zext-or-icmp.ll
The file was modifiedllvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll
The file was modifiedllvm/test/Transforms/InstCombine/widenable-conditions.ll
The file was modifiedllvm/test/Transforms/InstCombine/and-fcmp.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-safe-transforms.ll
The file was modifiedllvm/test/Transforms/InstCombine/and.ll
The file was modifiedllvm/test/Transforms/InstCombine/onehot_merge.ll
The file was modifiedllvm/test/Transforms/InstCombine/umul-sign-check.ll
The file was modifiedllvm/test/Transforms/InstCombine/prevent-cmp-merge.ll
The file was modifiedllvm/test/Transforms/LoopSimplify/merge-exits.ll
The file was modifiedllvm/test/Transforms/InstCombine/or-fcmp.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-bitext.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
The file was modifiedllvm/test/Transforms/InstCombine/logical-select-inseltpoison.ll
The file was modifiedllvm/test/Transforms/InstCombine/usub-overflow-known-by-implied-cond.ll
The file was modifiedllvm/test/Transforms/InstCombine/2012-03-10-InstCombine.ll
The file was modifiedllvm/test/Transforms/InstCombine/demorgan.ll
The file was modifiedllvm/test/Transforms/InstCombine/signed-truncation-check.ll
The file was modifiedllvm/test/Transforms/InstCombine/select.ll
The file was modifiedllvm/test/Transforms/InstCombine/icmp.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
The file was modifiedllvm/test/Transforms/InstCombine/and-or-icmps.ll
The file was modifiedllvm/test/Transforms/InstCombine/div-by-0-guard-before-umul_ov-not.ll
The file was modifiedllvm/test/Transforms/InstCombine/assume.ll
The file was modifiedllvm/test/Transforms/InstCombine/or.ll
The file was modifiedllvm/test/Transforms/InstCombine/range-check.ll
The file was modifiedllvm/test/Transforms/InstCombine/and-or-icmp-min-max.ll
The file was modifiedllvm/test/Transforms/InstCombine/and-or-icmp-nullptr.ll
The file was modifiedllvm/test/Transforms/InstCombine/2008-02-28-OrFCmpCrash.ll
The file was modifiedllvm/test/Transforms/InstCombine/bit-checks.ll
The file was modifiedllvm/test/Transforms/InstCombine/div-by-0-guard-before-smul_ov.ll
The file was modifiedllvm/test/Transforms/InstCombine/div-by-0-guard-before-smul_ov-not.ll
The file was modifiedllvm/test/Transforms/InstCombine/logical-select.ll
Commit 5f395223200bbe32bc17c731b4063ac2b58e51d9 by i
[test] Delete redundant arm64-tls-relocs.s

It just replicates tls-relocs.s
The file was removedllvm/test/MC/AArch64/arm64-tls-relocs.s
Commit 1b11b5b01fd8887a9c471b10cd99f0a60f6b2e50 by i
[AArch64] Replace fixup_aarch64_tlsdesc_call with FirstLiteralRelocationKind + R_AARCH64_{,P32_}TLSDESC_CALL
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64FixupKinds.h
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
The file was modifiedllvm/test/MC/AArch64/tls-relocs.s
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
The file was modifiedllvm/lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp
Commit f6d7fc801b4a513a5d5e04762e0e4c71414ae5ef by minyihh
[M68k][test][NFC] Scrubing some tests

Remove unecessary labels and assembly directives. NFC.
The file was modifiedllvm/test/MC/M68k/Arith/Classes/MxNEG.s
The file was modifiedllvm/test/MC/M68k/Bits/Classes/MxBTST_MI.s
The file was modifiedllvm/test/MC/M68k/Data/Classes/MxMoveCCR.s
The file was modifiedllvm/test/MC/M68k/Data/Classes/MxLEA.s
The file was modifiedllvm/test/MC/M68k/Data/Classes/MxMove_MI.s
The file was modifiedllvm/test/MC/M68k/Bits/Classes/MxBTST_MR.s
The file was modifiedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_FMR.s
The file was modifiedllvm/test/MC/M68k/Arith/Classes/MxBiArOp_FMI.s
The file was modifiedllvm/test/MC/M68k/Control/Classes/MxScc.s
Commit 6617a5a5eaeec455a2c4e1df9589208bcd5e6678 by Austin.Kerbow
[AMDGPU] Move insertion of function entry waitcnt later

This allows tracking these as preexisting waitcnt.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D101380
The file was modifiedllvm/test/CodeGen/AMDGPU/waitcnt-preexisting.mir
The file was modifiedllvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
Commit ab90ae6f476d439c275f8b7ce5fe8b827f9c390e by Stanislav.Mekhanoshin
[AMDGPU] Switch AnnotateUniformValues to MemorySSA

This shall speedup compilation and also remove threshold
limitations used by memory dependency analysis.

It also seem to fix the bug in the coalescer_remat.ll
where an SMRD load was used in presence of a potentially
clobbering store.

Fixes: SWDEV-272132

Differential Revision: https://reviews.llvm.org/D101962
The file was modifiedllvm/test/CodeGen/AMDGPU/llc-pipeline.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/soft-clause-exceeds-register-budget.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/coalescer_remat.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/global-smrd-unknown.ll
Commit 6fac34251d015b2f196dfb46dd015a914b8d6340 by kostyak
[scudo] Add initialization for TSDRegistrySharedT

Fixes compilation on Android which has a TSDSharedRegistry object in the config.

Reviewed By: cryptoad, vitalybuka

Differential Revision: https://reviews.llvm.org/D101951
The file was modifiedcompiler-rt/lib/scudo/standalone/tsd_shared.h
Commit 7b73cd684a8d5fb44d34064200f10e2723085c33 by Lang Hames
[ORC] Introduce C API for adding object buffers directly to an object layer.

This can be useful for clients constructing custom JIT stacks: If the C API
for your custom stack exposes API to obtain a reference to an object layer
(e.g. LLVMOrcLLJITGetObjLinkingLayer) then the newly added
LLVMOrcObjectLayerAddObjectFile and LLVMOrcObjectLayerAddObjectFileWithRT
functions can be used to add objects directly to that layer.
The file was modifiedllvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp
The file was modifiedllvm/include/llvm-c/Orc.h
Commit f97b843d8819f824dcc1b6afa746ce9a7a386db3 by georgakoudis1
[OpenMP] Fix non-determinism in clang copyin codegen

Codegen for OpeMP copyin has non-deterministic IR output due to the unspecified evaluation order in a codegen conditional branch, which makes automatic test generation unreliable. This patch refactors codegen code to avoid this non-determinism.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D101952
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
Commit abdd14a2d785226fde54ae81d897fdf4f2fec946 by Lang Hames
[ORC] Add missing library dependency on IRReader.
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
Commit 6bdfcb165e66a3f59fcf8e51ea0f2ecc0e3a32d5 by Jinsong Ji
[BPF][Test] Disable codegen test on AIX

https://reviews.llvm.org/D101194 changed the default getMultiarchTriple in toolchain.
So -march=bpf on AIX will get triple of bpf-ibm-aix now,
this is unexpected and causing test failures.

BPF on AIX is not supported (yet), disable the codegen test on AIX in lit cfg.

Reviewed By: yonghong-song

Differential Revision: https://reviews.llvm.org/D101866
The file was modifiedllvm/test/CodeGen/BPF/lit.local.cfg
Commit 6c80361b8474535852afb2f7201370fb5f410091 by jrtc27
[SelectionDAG][Mips][PowerPC][RISCV][WebAssembly] Teach computeKnownBits/ComputeNumSignBits about atomics

Unlike normal loads these don't have an extension field, but we know
from TargetLowering whether these are sign-extending or zero-extending,
and so can optimise away unnecessary extensions.

This was noticed on RISC-V, where sign extensions in the calling
convention would result in unnecessary explicit extension instructions,
but this also fixes some Mips inefficiencies. PowerPC sees churn in the
tests as all the zero extensions are only for promoting 32-bit to
64-bit, but these zero extensions are still not optimised away as they
should be, likely due to i32 being a legal type.

This also simplifies the WebAssembly code somewhat, which currently
works around the lack of target-independent combines with some ugly
patterns that break once they're optimised away.

Re-landed with correct handling in ComputeNumSignBits for Tmp == VTBits,
where zero-extending atomics were incorrectly returning 0 rather than
the (slightly confusing) required return value of 1.

Reviewed By: RKSimon, atanasyan

Differential Revision: https://reviews.llvm.org/D101342
The file was modifiedllvm/test/CodeGen/RISCV/atomic-signext.ll
The file was modifiedllvm/test/CodeGen/PowerPC/atomics-i16-ldst.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
The file was modifiedllvm/test/CodeGen/PowerPC/atomics-i8-ldst.ll
The file was modifiedllvm/test/CodeGen/PowerPC/atomics-i32-ldst.ll
The file was modifiedllvm/test/CodeGen/Mips/atomic.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/atomics-i64-ldst.ll
Commit 207b08a9130bd8167851f9e053f5d67bfd1969c8 by georgakoudis1
[OpenMP][NFC] Refactor Clang OpenMP tests using update_cc_test_checks

This patch refactors a subset of Clang OpenMP tests, generating checklines using the update_cc_test_checks script. This refactoring facilitates updating the Clang OpenMP code generation codebase by automating test generation.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D101849
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_proc_bind_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/tile_codegen.cpp
The file was modifiedclang/test/OpenMP/single_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/openmp_win_codegen.cpp
The file was modifiedclang/test/OpenMP/target_codegen_global_capture.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_if_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/master_taskloop_in_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_copyin_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_parallel_reduction_codegen_tbaa_PR46146.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_num_threads_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_nested_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/task_codegen.cpp
The file was modifiedclang/test/OpenMP/debug-info-openmp-array.cpp
The file was modifiedclang/test/OpenMP/distribute_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_private_codegen.cpp
The file was modifiedclang/test/OpenMP/for_reduction_codegen_UDR.cpp
The file was modifiedclang/test/OpenMP/teams_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_teams_codegen.cpp
The file was modifiedclang/test/OpenMP/for_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_generic_mode_codegen.cpp
The file was modifiedclang/test/OpenMP/sections_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/single_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_if_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_if_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/for_private_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_lambda_capturing.cpp
The file was modifiedclang/test/OpenMP/single_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/sections_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_private_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_allocate_codegen.cpp
The file was modifiedclang/test/OpenMP/cancellation_point_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_order_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_private_codegen.cpp
The file was modifiedclang/test/OpenMP/task_in_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_master_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_for_lastprivate_conditional.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_distribute_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_proc_bind_codegen.cpp
The file was modifiedclang/test/OpenMP/master_taskloop_simd_in_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_map_codegen_03.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/for_linear_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_multi_target_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_num_teams_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_proc_bind_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/for_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/ordered_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp
The file was modifiedclang/test/OpenMP/declare_target_codegen_globalization.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_private_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_private_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_for_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/task_if_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_teams_distribute_parallel_for_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_debug_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_master_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/for_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_private_codegen.cpp
The file was modifiedclang/test/OpenMP/debug-info-complex-byval.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_private_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_private_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_debug_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_thread_limit_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_proc_bind_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_proc_bind_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_sections_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_codegen.cpp
The file was modifiedclang/test/OpenMP/taskloop_simd_in_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_data_sharing.cpp
The file was modifiedclang/test/OpenMP/nvptx_teams_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_if_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_for_linear_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_private_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_simd_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_proc_bind_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_map_codegen.cpp
The file was modifiedclang/test/OpenMP/cancel_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_lastprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/sections_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/taskloop_in_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_codegen.cpp
The file was modifiedclang/test/OpenMP/parallel_sections_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/sections_reduction_task_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_collapse_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_parallel_for_simd_private_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/distribute_simd_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/for_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/sections_reduction_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_dist_schedule_codegen.cpp
The file was modifiedclang/test/OpenMP/vla_crash.c
Commit 16c7829784f071d9fd4ae9da4cc8b3786a58018e by kadircet
[clangd] Check if macro is already in the IdentifierTable before loading it

Having nested macros in the C code could cause clangd to fail an assert in clang::Preprocessor::setLoadedMacroDirective() and crash.

#1 0x00000000007ace30 PrintStackTraceSignalHandler(void*) /qdelacru/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
#2 0x00000000007aaded llvm::sys::RunSignalHandlers() /qdelacru/llvm-project/llvm/lib/Support/Signals.cpp:76:20
#3 0x00000000007ac7c1 SignalHandler(int) /qdelacru/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
#4 0x00007f096604db20 __restore_rt (/lib64/libpthread.so.0+0x12b20)
#5 0x00007f0964b307ff raise (/lib64/libc.so.6+0x377ff)
#6 0x00007f0964b1ac35 abort (/lib64/libc.so.6+0x21c35)
#7 0x00007f0964b1ab09 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21b09)
#8 0x00007f0964b28de6 (/lib64/libc.so.6+0x2fde6)
#9 0x0000000001004d1a clang::Preprocessor::setLoadedMacroDirective(clang::IdentifierInfo*, clang::MacroDirective*, clang::MacroDirective*) /qdelacru/llvm-project/clang/lib/Lex/PPMacroExpansion.cpp:116:5

An example of the code that causes the assert failure:
```
...
```

During code completion in clangd, the macros will be loaded in loadMainFilePreambleMacros() by iterating over the macro names and calling PreambleIdentifiers->get(). Since these macro names are store in a StringSet (has StringMap underlying container), the order of the iterator is not guaranteed to be same as the order seen in the source code.

When clangd is trying to resolve nested macros it sometimes attempts to load them out of order which causes a macro to be stored twice. In the example above, ECHO2 macro gets resolved first, but since it uses another macro that has not been resolved it will try to resolve/store that as well. Now there are two MacroDirectives stored in the Preprocessor, ECHO and ECHO2. When clangd tries to load the next macro, ECHO, the preprocessor fails an assert in clang::Preprocessor::setLoadedMacroDirective() because there is already a MacroDirective stored for that macro name.

In this diff, I check if the macro is already inside the IdentifierTable and if it is skip it so that it is not resolved twice.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D101870
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
The file was modifiedclang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
Commit 875eb523c13249114507cb8facd797773e278d9e by uday
[MLIR][GPU][NVVM] Add warp synchronous matrix-multiply accumulate ops

Add warp synchronous matrix-multiply accumulate ops in GPU and NVVM
dialect. Add following three ops to GPU dialect :-
  1.) subgroup_mma_load_matrix
  2.) subgroup_mma_store_matrix
  3.) subgroup_mma_compute
Add following three ops to NVVM dialect :-
  1.) wmma.m16n16k16.load.[a,b,c].[f16,f32].row.stride
  2.) wmma.m16n16k16.store.d.[f16,f32].row.stride
  3.) wmma.m16n16k16.mma.row.row.[f16,f32].[f16,f32]

Reviewed By: bondhugula, ftynse, ThomasRaoux

Differential Revision: https://reviews.llvm.org/D95330
The file was modifiedmlir/test/Dialect/LLVMIR/invalid.mlir
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUOps.td
The file was modifiedmlir/test/Dialect/GPU/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUBase.td
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
The file was modifiedmlir/lib/Target/LLVMIR/Dialect/NVVM/NVVMToLLVMIRTranslation.cpp
The file was modifiedmlir/test/Dialect/GPU/invalid.mlir
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/test/Target/LLVMIR/nvvmir.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
Commit 5d8d994dfbe38fe86b1d883daa9fd8e47cdc1376 by johannes
[OpenMP] Make sure classes work on the device as they do on the host

We do provide `operator delete(void*)` in `<new>` but it should be
available by default. This is mostly boilerplate to test it and the
unconditional include of `<new>` in the header we always in include
on the device.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D100620
The file was modifiedclang/test/Headers/Inputs/include/stdlib.h
The file was addedclang/test/Headers/target_include_new.cpp
The file was addedclang/test/Headers/Inputs/include/new
The file was modifiedclang/lib/Headers/openmp_wrappers/new
The file was modifiedclang/lib/Headers/openmp_wrappers/__clang_openmp_device_functions.h
Commit 3f14596700093bce436ae27178c307e842398b65 by johannes
[OpenMP] Ensure the DefaultMapperId has a location

A user reported an assertion (below) but without a reproducer. I failed to
create a test myself but from the assertion one can derive the problem.
I set the DefaultMapperId location now to make sure this doesn't cause
trouble.

```
clang-13: .../DeclTemplate.h:1940:
void clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(clang::SourceLocation):
Assertion `Loc.isValid() && "point of instantiation must be valid!"' failed.
```

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D100621
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
Commit df729e2b82b3cfc602a2295b95b7fa55ab423e88 by johannes
[OpenMP] Overhaul `declare target` handling

This patch fixes various issues with our prior `declare target` handling
and extends it to support `omp begin declare target` as well.

This started with PR49649 in mind, trying to provide a way for users to
avoid the "ref" global use introduced for globals with internal linkage.
From there it went down the rabbit hole, e.g., all variables, even
`nohost` ones, were emitted into the device code so it was impossible to
determine if "ref" was needed late in the game (based on the name only).
To make it really useful, `begin declare target` was needed as it can
carry the `device_type`. Not emitting variables eagerly had a ripple
effect. Finally, the precedence of the (explicit) declare target list
items needed to be taken into account, that meant we cannot just look
for any declare target attribute to make a decision. This caused the
handling of functions to require fixup as well.

I tried to clean up things while I was at it, e.g., we should not "parse
declarations and defintions" as part of OpenMP parsing, this will always
break at some point. Instead, we keep track what region we are in and
act on definitions and declarations instead, this is what we do for
declare variant and other begin/end directives already.

Highlights:
  - new diagnosis for restrictions specificed in the standard,
  - delayed emission of globals not mentioned in an explicit
    list of a declare target,
  - omission of `nohost` globals on the host and `host` globals on the
    device,
  - no explicit parsing of declarations in-between `omp [begin] declare
    variant` and the corresponding end anymore, regular parsing instead,
  - precedence for explicit mentions in `declare target` lists over
    implicit mentions in the declaration-definition-seq, and
  - `omp allocate` declarations will now replace an earlier emitted
    global, if necessary.

---

Notes:

The patch is larger than I hoped but it turns out that most changes do
on their own lead to "inconsistent states", which seem less desirable
overall.

After working through this I feel the standard should remove the
explicit declare target forms as the delayed emission is horrible.
That said, while we delay things anyway, it seems to me we check too
often for the current status even though that is often not sufficient to
act upon. There seems to be a lot of duplication that can probably be
trimmed down. Eagerly emitting some things seems pretty weak as an
argument to keep so much logic around.

---

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D101030
The file was modifiedclang/lib/AST/AttrImpl.cpp
The file was modifiedclang/test/OpenMP/for_firstprivate_codegen.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/single_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/remarks_parallel_in_multiple_target_state_machines.c
The file was modifiedclang/test/OpenMP/irbuilder_for_unsigned.c
The file was modifiedclang/test/OpenMP/nvptx_multi_target_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/threadprivate_codegen.cpp
The file was modifiedclang/test/Headers/nvptx_device_math_complex.c
The file was modifiedclang/test/OpenMP/irbuilder_for_iterator.cpp
The file was modifiedclang/test/OpenMP/remarks_parallel_in_target_state_machine.c
The file was modifiedclang/test/OpenMP/nvptx_declare_variant_name_mangling.cpp
The file was modifiedclang/test/OpenMP/parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/irbuilder_for_rangefor.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticParseKinds.td
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was modifiedclang/test/OpenMP/declare_target_messages.cpp
The file was modifiedclang/test/OpenMP/irbuilder_nested_parallel_for.c
The file was modifiedclang/test/OpenMP/parallel_master_taskloop_codegen.cpp
The file was modifiedclang/test/OpenMP/declare_target_codegen_globalization.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_codegen.cpp
The file was modifiedclang/test/OpenMP/taskgroup_codegen.cpp
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/CodeGen/CGDecl.cpp
The file was modifiedclang/test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedclang/include/clang/Parse/Parser.h
The file was modifiedclang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.h
The file was modifiedclang/test/OpenMP/nvptx_nested_parallel_codegen.cpp
The file was removedclang/test/OpenMP/declare_target_device_only_compilation.cpp
The file was modifiedclang/test/OpenMP/single_codegen.cpp
The file was addedclang/test/OpenMP/declare_target_only_one_side_compilation.cpp
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMP.td
The file was modifiedclang/test/OpenMP/task_codegen.cpp
The file was modifiedclang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/test/OpenMP/irbuilder_nested_openmp_parallel_empty.c
The file was modifiedclang/test/OpenMP/tile_codegen.cpp
The file was modifiedclang/test/OpenMP/sections_firstprivate_codegen.cpp
Commit b4795544d42b4c3d49fdf63b797b07f40242a427 by gchatelet
[llvm][NFC] Remove deprecated Alignment::None()

Differential Revision: https://reviews.llvm.org/D101905
The file was modifiedllvm/include/llvm/Support/Alignment.h
Commit a065efa302f64f225d9187b49b4dd061b5c58b08 by gchatelet
[llvm][NFC] Remove deprecated DataLayout::getPreferredAlignment functions

Differential Revision: https://reviews.llvm.org/D101906
The file was modifiedllvm/include/llvm/IR/DataLayout.h
Commit 040f4a97cd400e8464478e9b7c1d7d94d2bad708 by gchatelet
[llvm][NFC] Remove deprecated InterleaveGroup::getAlignment() function.

Differential Revision: https://reviews.llvm.org/D101907
The file was modifiedllvm/include/llvm/Analysis/VectorUtils.h
Commit 1fa21bf9e999f8fcb6e9137acb69aa940ad0e3ab by gchatelet
[llvm][NFC] Remove SelectionDag alignment deprecated functions

Differential Revision: https://reviews.llvm.org/D101909
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAG.h
Commit 089ec047bea8f6a0a47d8c4ad5142e9ca8b5aed9 by gchatelet
[llvm][NFC] Remove CallingConvLower deprecated alignment functions

Differential Revision: https://reviews.llvm.org/D101910
The file was modifiedllvm/include/llvm/CodeGen/CallingConvLower.h
Commit ab5932ffbd91b3989e20344cf104abe7c0cad1ae by tim.renouf
[llvm-objdump] Use std::make_unique

Fix up my recent commit rG1128311a19179ceca799ff0fbc4dd206ab56e560 to
use std::make_unique instead of std::unique_ptr(new), as requested by
David Blaikie.

Differential Revision: https://reviews.llvm.org/D101822
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.cpp
Commit abe2c906ad4c34d257e63b067fe8514050ea77ff by james.henderson
[lit] Report tool path from use_llvm_tool if found via env variable

Previously, if the search_env argument was specified, and the tool was
found at that location, the path was not reported, unlike other
situations when this function was called. Adding the reporting makes the
function consistent.

Reviewed by: thopre

Differential Revision: https://reviews.llvm.org/D101896
The file was addedllvm/utils/lit/tests/use-tool-search-env.py
The file was addedllvm/utils/lit/tests/Inputs/use-tool-search-env/test.tool
The file was modifiedllvm/utils/lit/lit/llvm/config.py
The file was addedllvm/utils/lit/tests/Inputs/use-tool-search-env/true.txt
The file was addedllvm/utils/lit/tests/Inputs/use-tool-search-env/lit.cfg
Commit b856f4a232cbd43476e9b9f75c80aacfc6f5c152 by malhar.jajoo
[ARM] Transforming memcpy to Tail predicated Loop

This patch converts llvm.memcpy intrinsic into Tail Predicated
Hardware loops for a target that supports the Arm M-profile
Vector Extension (MVE).

From an implementation point of view, the patch

- adds an ARM specific SDAG Node (to which the llvm.memcpy intrinsic is lowered to, during first phase of ISel)
- adds a corresponding TableGen entry to generate a pseudo instruction, with a custom inserter,
  on matching the above node.
- Adds a custom inserter function that expands the pseudo instruction into MIR suitable
   to be (by later passes) into a WLSTP loop.

Note: A cli option is used to control the conversion of memcpy to TP
loop and this option is currently disabled by default. It may be enabled
in the future after further downstream testing.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D99723
The file was modifiedllvm/lib/Target/ARM/ARMSubtarget.h
The file was addedllvm/test/CodeGen/Thumb2/mve-tp-loop.mir
The file was modifiedllvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/memcall.ll
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.h
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
The file was modifiedllvm/lib/Target/ARM/ARMInstrMVE.td
The file was modifiedllvm/lib/Target/ARM/ARMTargetTransformInfo.h
The file was addedllvm/test/CodeGen/Thumb2/mve-tp-loop.ll
Commit 65cd0d6be47730cefdd5be26c12f02ec59b4d08e by andrzej.warzynski
[flang] Remove `%f18` from LIT configuration files

`%f18` was originally introduced to represent the old Flang driver,
`f18`. With the introduction of the new driver, `flang-new`, we have
been switching to `%flang` (compiler driver) and `%flang_fc1` (frontend
driver) as more generic alternatives.

As most tests have been portend to use the new LIT variables instead of
`%f18`, this is good time to remove it from lit.cfg.py. There's only one
test left that requires the old driver to run. It's updated with:
```
! REQUIRES: old-flang-driver
```
This way we preserve its semantics while reducing the number of
variables in LIT configuration.

Differential Revision: https://reviews.llvm.org/D101281
The file was modifiedflang/test/Driver/help-f18.f90
The file was modifiedflang/test/lit.cfg.py
Commit 7c706af03b8634f1f2a64599037580e5f4785082 by jay.foad
[AMDGPU] SIFoldOperands: clean up tryConstantFoldOp

First clean up the strange API of tryConstantFoldOp where it took an
immediate operand value, but no indication of which operand it was the
value for.

Second clean up the loop that calls tryConstantFoldOp so that it does
not have to restart from the beginning every time it folds an
instruction.

This is NFCI but there are some minor changes caused by the order in
which things are folded.

Differential Revision: https://reviews.llvm.org/D100031
The file was modifiedllvm/lib/Target/AMDGPU/SIFoldOperands.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
Commit a437befa8f8580b3b4f2226b208a05da078c8b20 by marek.kurdej+llvm.org
[clang-format] Add more support for C# 8 nullables

This adds support for the null-coalescing assignment and null-forgiving
operators.

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-coalescing-operator

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/null-forgiving

Reviewed By: krasimir, curdeius

Differential Revision: https://reviews.llvm.org/D101702
The file was modifiedclang/lib/Format/FormatTokenLexer.h
The file was modifiedclang/lib/Format/FormatToken.h
The file was modifiedclang/unittests/Format/FormatTestCSharp.cpp
The file was modifiedclang/lib/Format/FormatTokenLexer.cpp
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
Commit ec725b307f3fdc5656459047bab6e69669d9534f by marek.kurdej+llvm.org
[clang-format] Fix C# nullable-related errors

This fixes two errors:

Previously, clang-format was splitting up type identifiers from the
nullable ?. This changes this behavior so that the type name sticks with
the operator.

Additionally, nullable operators attached to return types in interface
functions were not parsed correctly. Digging deeper, it looks like
interface bodies were being parsed differently than classes and structs,
causing MustBeDeclaration to be incorrect for interface members. They
now share the same logic.

One other change is reintroducing the CSharpNullable type independent of
JsTypeOptionalQuestion. Despite having a similar semantic purpose, their
actual syntax differs quite a bit.

Reviewed By: MyDeveloperDay, curdeius

Differential Revision: https://reviews.llvm.org/D101860
The file was modifiedclang/lib/Format/UnwrappedLineParser.h
The file was modifiedclang/unittests/Format/FormatTestCSharp.cpp
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/lib/Format/FormatToken.h
The file was modifiedclang/lib/Format/TokenAnnotator.cpp
Commit cdf33962d9768fbd8d6b193aff463a21eaa984f3 by marek.kurdej+llvm.org
[clang-format] Rename common types between C#/JS

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D101862
The file was modifiedclang/lib/Format/FormatTokenLexer.cpp
The file was modifiedclang/lib/Format/UnwrappedLineParser.cpp
The file was modifiedclang/lib/Format/FormatToken.h
The file was modifiedclang/lib/Format/TokenAnnotator.cpp