LLVM/project 83451d8clang/lib/CIR/CodeGen TargetInfo.cpp CIRGenModule.cpp, clang/lib/CIR/CodeGen/Targets AMDGPU.cpp

[CIR][AMDGPU] Add AMDGPU-specific function attributes for HIP kernels (#188007)

Upstreaming clangIR PR: https://github.com/llvm/clangir/pull/2091

This patch adds support for AMDGPU-specific function attributes for HIP
kernels

Added setTargetAttributes for AMDGPUTargetCIRGenInfo to set kernel
attributes
Added generic string attribute handler in amendFunction to translate
string-values with "cir." prefix function attributes to LLVM function
attributes
Follows OGCG AMDGPU implementation from
"clang/lib/CodeGen/Targets/AMDGPU.cpp".
DeltaFile
+255-0clang/lib/CIR/CodeGen/Targets/AMDGPU.cpp
+98-0clang/test/CIR/CodeGenHIP/amdgpu-attrs.hip
+21-3clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVMIR.cpp
+17-0clang/lib/CIR/CodeGen/TargetInfo.cpp
+8-6clang/lib/CIR/CodeGen/CIRGenModule.cpp
+9-0clang/lib/CIR/CodeGen/TargetInfo.h
+408-92 files not shown
+409-108 files

LLVM/project 3bef187clang/include/clang/CIR MissingFeatures.h, clang/include/clang/CIR/Interfaces CIROpInterfaces.td

update CIRGlobalValueInterface for section
DeltaFile
+16-0clang/include/clang/CIR/Interfaces/CIROpInterfaces.td
+2-4clang/lib/CIR/CodeGen/CIRGenModule.cpp
+0-1clang/include/clang/CIR/MissingFeatures.h
+18-53 files

LLVM/project accf41ellvm/include/llvm/Analysis DependenceAnalysis.h, llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Add precondition `0 <=s UB` to function `inferAffineDomain` (#187218)

This patch fixes issues where the Exact SIV/RDIV tests can return
incorrect results when the BTC is negative in a signed sense. The root
cause is that BTCs should be interpreted in an unsigned sense, but
`inferAffineDomain` uses the BTC in inequalities that are interpreted in
a signed sense. These inequalities make sense only when the BTC is
non-negative. Thus we need to check it beforehand.
DeltaFile
+27-29llvm/lib/Analysis/DependenceAnalysis.cpp
+5-4llvm/include/llvm/Analysis/DependenceAnalysis.h
+2-2llvm/test/Analysis/DependenceAnalysis/rdiv-large-btc.ll
+34-353 files

LLVM/project 8a49af8clang/lib/AST/ByteCode Interp.h Compiler.cpp

[clang][bytecode] Pass bitfield width directly to opcodes (#188423)

Pass a `FieldOffset` + `FieldBitWidth` pair instead of a `Record::Field`
pointer.
DeltaFile
+16-18clang/lib/AST/ByteCode/Interp.h
+9-6clang/lib/AST/ByteCode/Compiler.cpp
+3-11clang/lib/AST/ByteCode/Opcodes.td
+4-0clang/lib/AST/ByteCode/Record.h
+32-354 files

LLVM/project 924a4adlibc/shared/math f16subl.h bf16fmal.h

[libc] Guard long double shared math functions against double-double. (#188909)
DeltaFile
+6-0libc/shared/math/f16subl.h
+6-0libc/shared/math/bf16fmal.h
+6-0libc/shared/math/bf16mull.h
+6-0libc/shared/math/canonicalizel.h
+6-0libc/shared/math/ceill.h
+6-0libc/shared/math/daddl.h
+36-025 files not shown
+186-031 files

LLVM/project 5c361baclang/test/Analysis ctu-main.cpp, clang/test/Analysis/ctu main.cpp

Merge branch 'main' into users/kasuga-fj/da-fix-large-btc-for-exact-tests
DeltaFile
+290-378llvm/test/CodeGen/X86/srem-vector-lkk.ll
+624-0llvm/test/CodeGen/AMDGPU/ctls.ll
+138-248llvm/test/CodeGen/X86/urem-vector-lkk.ll
+285-101llvm/test/CodeGen/X86/srem-seteq-vec-nonsplat.ll
+0-249clang/test/Analysis/ctu-main.cpp
+249-0clang/test/Analysis/ctu/main.cpp
+1,586-976587 files not shown
+11,614-6,741593 files

LLVM/project 46c47efllvm/lib/Target/Hexagon HexagonLoadStoreWidening.cpp, llvm/test/CodeGen/Hexagon store-widen-subreg.mir

[Hexagon] Fix load/store widening to preserve subreg operands (#188181)

HexagonLoadStoreWidening pass was incorrectly using DoubleRegs registers
where IntRegs was required when widening load/store pairs. When the
S2_addasl_rrri instruction used a subreg (e.g., %2.isub_lo), the
widening pass extracted only the base register without preserving the
subreg, causing machine verifier errors.
DeltaFile
+34-0llvm/test/CodeGen/Hexagon/store-widen-subreg.mir
+14-2llvm/lib/Target/Hexagon/HexagonLoadStoreWidening.cpp
+48-22 files

LLVM/project f1889a7clang/lib/Lex PPDirectives.cpp, clang/test/ClangScanDeps p1689-suppress-warnings-no-eol.cppm

[ClangScanDeps] Avoid use-of-uninitialized-memory for end-of-directive edge case (#188590)

https://github.com/llvm/llvm-project/pull/186966 was reverted because
the test case triggered a use-of-uninitialized-memory
(https://lab.llvm.org/buildbot/#/builders/94/builds/16379), due to the
include directive omitting a trailing newline. This patch adds a minor
fix to avoid the use-of-uninitialized-memory, and deliberately re-adds
the test case sans trailing newline for regression testing.

MSan report prior to this fix:
```
@@@BUILD_STEP sanitizer logs: stage2/msan_track_origins check@@@
==clang-scan-deps==616960==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x5555599c3300 in isAnnotation /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Lex/Token.h:131:38
    #1 0x5555599c3300 in setLength /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Lex/Token.h:152:13
    #2 0x5555599c3300 in clang::Lexer::FormTokenWithChars(clang::Token&, char const*, clang::tok::TokenKind) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/Lex/Lexer.h:644:12
    #3 0x5555599cf895 in clang::Lexer::LexEndOfFile(clang::Token&, char const*) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Lex/Lexer.cpp:3166:5
    #4 0x555559bb229b in clang::Preprocessor::Lex(clang::Token&) /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Lex/Preprocessor.cpp:916:11
    #5 0x555559aa5365 in __invoke<void (clang::Preprocessor::*&)(clang::Token &), clang::Preprocessor *, clang::Token &> /home/b/sanitizer-x86_64-linux-bootstrap-msan/build/libcxx_install_msan_track_origins/include/c++/v1/__type_traits/invoke.h:90:27

    [5 lines not shown]
DeltaFile
+25-0clang/test/ClangScanDeps/p1689-suppress-warnings-no-eol.cppm
+3-0clang/lib/Lex/PPDirectives.cpp
+28-02 files

LLVM/project 9c98207clang/docs ReleaseNotes.rst, clang/include/clang/Sema Sema.h

[clang][Modules] Reject export declarations in implementation partitions (#188698)

[module.interface]/1 says:

> An export-declaration shall [...] appear in the purview of
   a module interface unit.

But clang currently fails to enforce this rule in implementation
partitions.

Partially addresses #107602.
DeltaFile
+18-0clang/test/CXX/module/module.interface/p1.cpp
+4-3clang/include/clang/Sema/Sema.h
+3-0clang/docs/ReleaseNotes.rst
+25-33 files

LLVM/project 3ef59d8llvm/lib/Target/Hexagon HexagonFrameLowering.cpp, llvm/test/CodeGen/Hexagon aligna-prologue-expansion.mir

[Hexagon] Fix use-before-def of AP register in prologue CSR spills (#188504)

PS_aligna initializes the AP register (eg:callee-saved R16) with an
aligned value derived from FP. It was being placed before the 
CSR spills, causing the spill of R16 to save the AP value instead of the 
caller's original R16, breaking the callee-saved register contract and 
it must be defined before any AP-relative stack accesses. Fix by moving 
PS_aligna to after all CSR spills in insertCSRSpillsInBlock().

Fixes #184531
DeltaFile
+92-0llvm/test/CodeGen/Hexagon/aligna-prologue-expansion.mir
+30-12llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
+122-122 files

LLVM/project 18f6191clang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp, clang/test/CIR/CodeGenCUDA device-stub.cu

[CIR][CUDA] Handle CUDA module constructor and destructor emission.
DeltaFile
+122-2clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+41-0clang/test/CIR/CodeGenCUDA/device-stub.cu
+163-22 files

LLVM/project e43ce53llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/RISCV rv32p.ll

[TargetLowering][RISCV] Prefer (S/U)MUL_LOHI over MULH(S/U) in expandMULO. (#188870)

The RISC-V P extension adds WMUL and WMULU instruction that produce
a full 64-bit product in 2 GPRs. The base ISA already had MULH and
MULHU.
DeltaFile
+32-0llvm/test/CodeGen/RISCV/rv32p.ll
+6-6llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+38-62 files

LLVM/project cbe9891clang/lib/CodeGen CodeGenModule.cpp, clang/test/CodeGenCXX reference-temporary-subobject.cpp bad-codegen-for-constexpr-structured-bindings.cpp

[Clang] fix bad codegen from constexpr structured bindings (#186594)

Resolves: https://github.com/llvm/llvm-project/issues/164150

C++26 allows for constexpr packs in structured bindings. This is a new
feature (the code doesn't compile on lower the -std=c++26) and so was
previously unhandled in clang.

This makes clang aware of packs and handle them as one constant unit
instead of materializing them as separate mutable reference temporaries
allowing llvm to optimize them.

This turns the example code from the issue into this as you would expect
without compiling for zen 5 (the good codegen described).

```asm
  movq    %rdi, %rax
  movups  (%rsi), %xmm0
  movups  %xmm0, (%rdi)

    [3 lines not shown]
DeltaFile
+50-0clang/test/CodeGenCXX/reference-temporary-subobject.cpp
+40-0clang/test/CodeGenCXX/bad-codegen-for-constexpr-structured-bindings.cpp
+29-0clang/test/CodeGenCXX/reference-temporary-mutable.cpp
+8-3clang/lib/CodeGen/CodeGenModule.cpp
+2-3clang/test/CodeGenCXX/temporaries.cpp
+1-2clang/test/CodeGenCXX/const-init-cxx11.cpp
+130-81 files not shown
+131-97 files

LLVM/project b163ba6llvm/lib/CodeGen/AsmPrinter DwarfCompileUnit.cpp DwarfCompileUnit.h, llvm/test/DebugInfo/X86 implicit-pointer-dwarf5.ll

[DebugInfo] Lower DW_OP_LLVM_implicit_pointer to DWARF (#186763)

This patch adds backend support by intercepting
`DW_OP_LLVM_implicit_pointer` during variable DIE emission in
DwarfCompileUnit. For each implicit pointer variable, an artificial
`DW_TAG_variable` DIE is created to describe the dereferenced value's
location, and the pointer variable's location is emitted as
`DW_OP_implicit_pointer` referencing that artificial DIE.

Constant integer entries are de-duplicated so that multiple pointer
variables referencing the same constant value share a single artificial
DIE.

Emits `DW_OP_implicit_pointer` for DWARF 5 and
`DW_OP_GNU_implicit_pointer` for DWARF 4.

Here is the RFC with the design
https://discourse.llvm.org/t/rfc-implementing-dw-op-implicit-pointer-support-in-llvm/90217


    [2 lines not shown]
DeltaFile
+118-0llvm/test/DebugInfo/X86/implicit-pointer-dwarf5.ll
+118-0llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+13-0llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+6-0llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+255-04 files

LLVM/project add5b81clang/bindings/python/clang cindex.py, clang/bindings/python/tests/cindex test_version.py

[libclang/python] Renaming `get_version` into `get_clang_version`  (#188515)

Rename `get_version` to `get_clang_version` to match the `libclang.so`
name[1], and be clear we doesn't return some `cindex.py` internal
versioning but the `libclang.so` one.

[1] This match was some current API are doing for example
`conf.lib.clang_getArraySize` is mapped to `get_array_size`.
DeltaFile
+2-2clang/docs/ReleaseNotes.rst
+1-1clang/bindings/python/tests/cindex/test_version.py
+1-1clang/bindings/python/clang/cindex.py
+4-43 files

LLVM/project f9acb06cross-project-tests/debuginfo-tests/llgdb-tests nrvo-string.cpp

[debuginfo-tests] Update line numbers in llgdb-tests/nrvo-string.cpp (#188901)

Update the line numbers in llgdb-tests/nrvo-string.cpp for #188780 which
shifts the file by 6 lines.
DeltaFile
+2-2cross-project-tests/debuginfo-tests/llgdb-tests/nrvo-string.cpp
+2-21 files

LLVM/project ac89303libc/src/__support/CPP monostate.h CMakeLists.txt, libc/src/__support/wctype perfect_hash_map.h

Apply suggestions from code review
DeltaFile
+90-74libc/src/__support/wctype/perfect_hash_map.h
+142-4libc/test/src/__support/wctype/wctype_perfect_hash_test.cpp
+0-31libc/src/__support/CPP/monostate.h
+0-8libc/src/__support/CPP/CMakeLists.txt
+5-2libc/utils/wctype_utils/conversion/hex_writer.py
+1-1libc/utils/wctype_utils/gen.py
+238-1203 files not shown
+243-1219 files

LLVM/project e55fb5dllvm/include/llvm/ExecutionEngine/Orc ExecutorResolutionGenerator.h EPCDynamicLibrarySearchGenerator.h, llvm/lib/ExecutionEngine/Orc LookupAndRecordAddrs.cpp SimpleRemoteEPC.cpp

[ORC] Move DylibManager ownership out of ExecutorProcessControl. (#188711)

This removes an unnecessary coupling between ExecutorProcessControl and
DylibManager, allowing clients to select DylibManager implementations
independently.

To simplify the transition, the
ExecutorProcessControl::createDefaultJITDylib method will return an
instance of whatever DylibManager the ExecutorProcessControl
implementation had been using previously.
DeltaFile
+0-28llvm/lib/ExecutionEngine/Orc/LookupAndRecordAddrs.cpp
+12-8llvm/include/llvm/ExecutionEngine/Orc/ExecutorResolutionGenerator.h
+14-5llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+11-8llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
+9-8llvm/lib/ExecutionEngine/Orc/SimpleRemoteEPC.cpp
+7-9llvm/lib/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.cpp
+53-6615 files not shown
+115-10621 files

LLVM/project 13379ef.github/workflows release-llvm-testing-tools.yml

upload

Created using spr 1.3.7
DeltaFile
+6-1.github/workflows/release-llvm-testing-tools.yml
+6-11 files

LLVM/project 9dbb4cfclang/lib/CIR/CodeGen CIRGenBuiltinRISCV.cpp, clang/test/CIR/CodeGenBuiltins/RISCV riscv-zihintpause.c

[CIR][RISCV] Support zihintpause builitin codegen (#188465)

Include one builtin: __builtin_riscv_pause.
DeltaFile
+30-2clang/lib/CIR/CodeGen/CIRGenBuiltinRISCV.cpp
+22-0clang/test/CIR/CodeGenBuiltins/RISCV/riscv-zihintpause.c
+52-22 files

LLVM/project 80b1fbeclang/tools/clang-linker-wrapper LinkerWrapperOpts.td ClangLinkerWrapper.cpp

[ClangLinkerWrapper] Fix `-v` for newer CMake passing it directly (#188883)

Summary:
Normally `-v` is version for tools, but it's also verbose for the
linker. CMake tries to identify the linker by passing `-Wl,-v` which
goes to the linker wrapper instead. Make this only print version on
`--version` and forward the other one to the linker so it appears
transparent to the host ABI. A bit of a hack, but it should work.
DeltaFile
+1-2clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td
+1-1clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+2-32 files

LLVM/project 863ee8c.github/workflows release-llvm-testing-tools.yml

fix

Created using spr 1.3.7
DeltaFile
+3-3.github/workflows/release-llvm-testing-tools.yml
+3-31 files

LLVM/project cfad6e1.github/workflows release-llvm-testing-tools.yml

fix

Created using spr 1.3.7
DeltaFile
+2-2.github/workflows/release-llvm-testing-tools.yml
+2-21 files

LLVM/project 84d5486.github/workflows release-llvm-testing-tools.yml

fix

Created using spr 1.3.7
DeltaFile
+2-0.github/workflows/release-llvm-testing-tools.yml
+2-01 files

LLVM/project d1e50fc.github/workflows release-llvm-testing-tools.yml

fix

Created using spr 1.3.7
DeltaFile
+1-1.github/workflows/release-llvm-testing-tools.yml
+1-11 files

LLVM/project d52da40.github/workflows release-llvm-testing-tools.yml, llvm/utils/llvm-testing-tools pyproject.toml README.md

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+36-0.github/workflows/release-llvm-testing-tools.yml
+21-0llvm/utils/llvm-testing-tools/pyproject.toml
+16-0llvm/utils/llvm-testing-tools/src/llvm_testing_tools/wrapper.py
+6-0llvm/utils/llvm-testing-tools/README.md
+0-0llvm/utils/llvm-testing-tools/src/llvm_testing_tools/__init__.py
+79-05 files

LLVM/project ab5ad1allvm/utils/llvm-testing-tools pyproject.toml README.md, llvm/utils/llvm-testing-tools/src/llvm_testing_tools wrapper.py __init__.py

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+21-0llvm/utils/llvm-testing-tools/pyproject.toml
+16-0llvm/utils/llvm-testing-tools/src/llvm_testing_tools/wrapper.py
+6-0llvm/utils/llvm-testing-tools/README.md
+0-0llvm/utils/llvm-testing-tools/src/llvm_testing_tools/__init__.py
+43-04 files

LLVM/project 2c0a67dllvm/lib/Target/AArch64 AArch64PostCoalescerPass.cpp

[AArch64] Update preserved analyses for AArch64PostCoalescer (#188875)

Preserving all analyses likely is a wrong assertion since we do not know
what other analyses might exist that we've updated.

Updated to preserve CFG, LiveIntervalsAnalysis and SlotIndexAnalysis
(which is transitively preserved from LiveIntervalsAnalysis)
DeltaFile
+4-1llvm/lib/Target/AArch64/AArch64PostCoalescerPass.cpp
+4-11 files

LLVM/project 601d502clang/test/CodeGenHIP incorrect-atomic-scope.hip, clang/test/CodeGenOpenCL incorrect-atomic-scope.cl

[Clang][NFC] Pre-commit tests for #185408

The tests demonstrate how incorrect LLVM IR is generated without diagnostics,
when an OpenCL or HIP scope number is passed to an AMDGPU intrinsic. #185408
lays the groundwork for properly diagnosing this situation by internally
using a separate enum type to represent each set of scope numbers.
DeltaFile
+13-0clang/test/CodeGenOpenCL/incorrect-atomic-scope.cl
+10-0clang/test/CodeGenHIP/incorrect-atomic-scope.hip
+23-02 files

LLVM/project 3b05b1bllvm/utils/llvm-testing-tools pyproject.toml README.md, llvm/utils/llvm-testing-tools/src/llvm_testing_tools wrapper.py __init__.py

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+21-0llvm/utils/llvm-testing-tools/pyproject.toml
+16-0llvm/utils/llvm-testing-tools/src/llvm_testing_tools/wrapper.py
+6-0llvm/utils/llvm-testing-tools/README.md
+0-0llvm/utils/llvm-testing-tools/src/llvm_testing_tools/__init__.py
+43-04 files