LLVM/project 5aa3f7dllvm/lib/Transforms/Scalar LoopLoadElimination.cpp LoopDistribute.cpp, llvm/lib/Transforms/Utils LoopVersioning.cpp

[LLE][LoopDistribution][LoopVersioning] Form LCSSA at Caller Invoking LoopVersioning Utility (#202296)

LoopVersioning utility `versionLoop()` expects the input form to be
LCSSA. However, passes like Loop distribution, Loop-load-elimination,
may invoke versioning with a non-LCSSA IR. Versioning updates exit-block
PHIs to handle both the original loop and the cloned loop. However, a
raw non-LCSSA use in the exit block (such as `switch i1 %C`) still
points to the original loop’s `%C`. On the cloned-loop path, control
reaches the exit block without executing the original `%C`, resulting in
error: `Instruction does not dominate all uses!`.

The fix is to form LCSSA at the caller pass.
DeltaFile
+240-0llvm/test/Transforms/LoopDistribute/non-lcssa-input.ll
+193-0llvm/test/Transforms/LoopLoadElim/non-lcssa-input.ll
+7-2llvm/lib/Transforms/Utils/LoopVersioning.cpp
+5-0llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
+3-0llvm/lib/Transforms/Scalar/LoopDistribute.cpp
+448-25 files

LLVM/project 3f3276ellvm/lib/Target/SPIRV SPIRVBuiltins.cpp SPIRVUtils.cpp

[NFC][SPIRV] Use `StringRef` by value (no `const`, no `&`) (#207940)

A `StringRef` is non-modifiable and it acts as a reference, so there is
no need to declare it as `const` nor `&`.

---------

Co-authored-by: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
DeltaFile
+11-11llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+8-10llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+5-5llvm/lib/Target/SPIRV/SPIRVBuiltins.h
+4-5llvm/lib/Target/SPIRV/SPIRVUtils.h
+1-1llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+1-1llvm/lib/Target/SPIRV/SPIRVMetadata.cpp
+30-336 files

LLVM/project d8bc450lldb/source/Plugins/Process/Utility LinuxSignals.cpp

[lldb][Linux] Show si_addr for SIGBUS signals (#207718)

The general rule is if si_addr is the same as the PC, we don't show it
because it doesn't add any new information.

SIGBUS signals are caused by an instruction trying to do something, but
si_addr is not the address of the instruction. It's some virtual
address, which is the important bit so add it to the description.

https://man7.org/linux/man-pages/man7/signal.7.html
> SIGBUS <...> Bus error (bad memory access)

Before:
```
* thread #1, name = 'test.o', stop reason = signal SIGBUS: illegal address
  * frame #0: 0x0000aaaaaaaa0b80 test.o`main at test.c:42:13
```
After:
```

    [7 lines not shown]
DeltaFile
+3-3lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
+3-31 files

LLVM/project 3c2de78llvm/lib/Target/SPIRV SPIRVUtils.cpp SPIRVUtils.h

[NFC][SPIRV] Make `getVacantFunctionName` static

The function is only used inside `SPIRVUtils.cpp`.
DeltaFile
+1-1llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+0-2llvm/lib/Target/SPIRV/SPIRVUtils.h
+1-32 files

LLVM/project fcd02aemlir/lib/Conversion/SPIRVToLLVM SPIRVToLLVM.cpp, mlir/test/Conversion/SPIRVToLLVM control-flow-ops-to-llvm.mlir

[mlir][SPIRVToLLVM] Add spirv.Unreachable to llvm.unreachable conversion (#207762)
DeltaFile
+18-0mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir
+15-0mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
+33-02 files

LLVM/project d9c133dllvm/lib/Target/SPIRV SPIRVUtils.cpp SPIRVUtils.h

[NFC][SPIRV] Remove dead helper `buildOpMemberDecorate(Register, MachineInstr &, ...)`
DeltaFile
+0-12llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+0-4llvm/lib/Target/SPIRV/SPIRVUtils.h
+0-162 files

LLVM/project 6e0de1clibsycl/include/sycl/__impl queue.hpp, libsycl/include/sycl/__impl/detail obj_utils.hpp

[libsycl] Implement memcpy API (#205369)
DeltaFile
+88-30libsycl/src/detail/queue_impl.cpp
+115-0libsycl/test/usm/memcpy.cpp
+85-0libsycl/unittests/queue/memcpy.cpp
+44-9libsycl/unittests/mock/helpers.cpp
+37-0libsycl/include/sycl/__impl/queue.hpp
+21-0libsycl/include/sycl/__impl/detail/obj_utils.hpp
+390-399 files not shown
+445-4815 files

LLVM/project 5318bd4libc/include elf.yaml CMakeLists.txt, libc/include/llvm-libc-macros sys-auxv-macros.h

[libc] Add auxiliary vector and note macros to elf.h (#207914)

Added missing macros to elf.h:

* sys-auxv-macros.h: Added AT_RSEQ_FEATURE_SIZE and AT_RSEQ_ALIGN.
* elf.yaml: Added PT_AARCH64_MEMTAG_MTE, PN_XNUM, ELFCLASSNUM, EV_NUM,
and AT_* macros (via sys-auxv-macros.h). Also added NN_* and NT_* note
macros (including NT_FPREGSET and NT_SIGINFO) to match system headers.
* CMakeLists.txt: Added sys_auxv_macros dependency to elf target.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+92-0libc/include/elf.yaml
+2-0libc/include/llvm-libc-macros/sys-auxv-macros.h
+1-0libc/include/CMakeLists.txt
+95-03 files

LLVM/project 62cb33ellvm/lib/Target/RISCV RISCVTargetTransformInfo.h

[RISCV] Enumerate all RecurKind cases in isLegalToVectorizeReduction. nfc (#207932)
DeltaFile
+12-1llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
+12-11 files

LLVM/project ee2f864llvm/lib/Target/RISCV RISCVTargetTransformInfo.cpp, llvm/test/Transforms/LoopVectorize/RISCV interleaved-accesses-i64-rv32.ll strided-accesses-i64-rv32.ll

[RISCV] Fix interleaved + strided costs for e64 elements on rv32 (#207927)

This is the same fix as #176105 for interleaved + strided memory op
costs.

We currently compute the cost of interleaved + strided ops as N *
scalar element memory ops, but on rv32 the scalar memory access will
be on an illegal type for 64 bit elements, even with zve64x. Prevent
it from overcosting by just using TCC_Basic.
DeltaFile
+55-0llvm/test/Transforms/LoopVectorize/RISCV/interleaved-accesses-i64-rv32.ll
+52-0llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses-i64-rv32.ll
+2-15llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+6-10llvm/test/Transforms/LoopVectorize/RISCV/early-exit-live-out.ll
+115-254 files

LLVM/project be450c7llvm/include/llvm/IR Instructions.h IRBuilder.h, llvm/lib/IR Instructions.cpp

Update for comments
DeltaFile
+12-0llvm/lib/IR/Instructions.cpp
+9-3llvm/include/llvm/IR/Instructions.h
+2-5llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+2-5llvm/include/llvm/IR/IRBuilder.h
+25-134 files

LLVM/project 7fc9724llvm/lib/Target/SPIRV SPIRVUtils.cpp

Apply suggestion from @aobolensk

Co-authored-by: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
DeltaFile
+0-1llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+0-11 files

LLVM/project aa0d6a1llvm/lib/Target/SPIRV SPIRVBuiltins.cpp SPIRVUtils.cpp

[NFC][SPIRV] Correct misuses of `StringRef`

A `StringRef` is non-modifiable and it acts as a reference, so there is
no need to declare it as `const` or `&`.
DeltaFile
+11-11llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+9-10llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+5-5llvm/lib/Target/SPIRV/SPIRVBuiltins.h
+4-5llvm/lib/Target/SPIRV/SPIRVUtils.h
+1-1llvm/lib/Target/SPIRV/SPIRVMetadata.cpp
+1-1llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+31-336 files

LLVM/project d6a4a97llvm/lib/Target/SPIRV SPIRVUtils.cpp SPIRVUtils.h

[NFC][SPIRV] Remove dead helper `addStringImm(const StringRef &Str, IRBuilder<> &B, std::vector<Value *> &Args)` (#207923)

The helper was unused.
DeltaFile
+0-9llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+0-2llvm/lib/Target/SPIRV/SPIRVUtils.h
+0-112 files

LLVM/project 81e3179clang/docs ReleaseNotes.md, clang/lib/AST ExprConstant.cpp

[clang] Fix constant-evaluator crash on array new with no size (#207730)

An array new-expression whose bound is neither specified nor deducible
from its initializer (for example `new int[]()`) is ill-formed and is
already diagnosed by Sema with `error: cannot determine allocated array
size from initializer`. However, the constant evaluator still tried to
evaluate the recovery expression. In
`PointerExprEvaluator::VisitCXXNewExpr`
the array size is unavailable (`E->getArraySize()` is `nullopt`), so the
allocation fell through to the scalar-new path, producing an array
`APValue` stored under a scalar type. Reading that object later asserted
in `Type::castAsArrayTypeUnsafe()` (`isa<ArrayType>(CanonicalType)`)
from
`CheckEvaluationResult`.

This patch detects an array new-expression whose size could not be
determined and bails out of constant evaluation.

Fixes #200139
DeltaFile
+7-0clang/lib/AST/ExprConstant.cpp
+6-0clang/test/SemaCXX/constant-expression-cxx2a.cpp
+1-0clang/docs/ReleaseNotes.md
+14-03 files

LLVM/project 503f0callvm/lib/Target/SPIRV SPIRVUtils.cpp

[SPIR-V] Simplify and fix sign-extension bug in convertCharsToWord (#207769)
DeltaFile
+4-9llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+4-91 files

LLVM/project c70f04allvm/lib/Transforms/Scalar GVN.cpp, llvm/test/Transforms/GVN/PRE pre-loop-load.ll

fixup! [GVN] Support critical-edge splitting in loop-load PRE
DeltaFile
+59-0llvm/test/Transforms/GVN/PRE/pre-loop-load.ll
+7-11llvm/lib/Transforms/Scalar/GVN.cpp
+66-112 files

LLVM/project 16c8410llvm/test/Transforms/GVN/PRE pre-loop-load.ll

[GVN] Add tests for loop-load PRE into a multi-successor block

Precommit tests for loop-load PRE when the loaded pointer cannot be freed (a gc-managed address-space pointer and a nofree function). PRE currently fires but sinks the reload into a cold block with multiple successors, so it also runs on the loop-exit edge.
DeltaFile
+114-0llvm/test/Transforms/GVN/PRE/pre-loop-load.ll
+114-01 files

LLVM/project 5a6f093llvm/lib/Transforms/Scalar GVN.cpp, llvm/test/Transforms/GVN/PRE pre-loop-load.ll

[GVN] Support critical-edge splitting in loop-load PRE

When the only in-loop blocker of a loop-load PRE candidate has multiple successors, the reload was placed at the end of that block, so it also ran on the loop-exit edge. Split the critical edge to the unique in-loop successor and insert the reload there, so it runs only on the path back to the header. Bail out on indirectbr or multiple in-loop successors, and keep backedge splitting gated behind the existing flag. Also refresh the stale TODO comments on the freeable-pointer tests, which stay un-PRE'd because the pointer may be freed.
DeltaFile
+35-2llvm/lib/Transforms/Scalar/GVN.cpp
+21-13llvm/test/Transforms/GVN/PRE/pre-loop-load.ll
+56-152 files

LLVM/project ec9e62cmlir/lib/Dialect/XeGPU/Transforms XeGPULayoutImpl.cpp

[MLIR][XeGPU] Move arch-specific topology under uArch check (#207449)
DeltaFile
+26-17mlir/lib/Dialect/XeGPU/Transforms/XeGPULayoutImpl.cpp
+26-171 files

LLVM/project 31e30ebllvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp

remove r600 check
DeltaFile
+1-2llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+1-21 files

LLVM/project d9ce6declang/include/clang/Driver CommonArgs.h, clang/lib/Driver/ToolChains CommonArgs.cpp AMDGPU.cpp

clang/AMDGPU: Fix double linking opencl libs with --libclc-lib

Noticed by inspection. If using an explicit --libclc-lib flag,
do not attempt to also link the rocm device libs which will contain
different implementations of the same opencl symbols.

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+8-7clang/lib/Driver/ToolChains/CommonArgs.cpp
+9-0clang/test/Driver/opencl-libclc.cl
+5-1clang/include/clang/Driver/CommonArgs.h
+2-1clang/lib/Driver/ToolChains/AMDGPU.cpp
+24-94 files

LLVM/project cd0fec9clang/lib/Driver/ToolChains AMDGPU.cpp, clang/test/Driver amdgpu-openmp-gpu-max-threads-per-block.c

clang/AMDGPU: Remove driver restriction on --gpu-max-threads-per-block

Previously this flag was only handled for HIP, and would produce an unused
argument warning. There is a custom warning produced by cc1 that the
argument isn't supported, but practically speaking that was unreachable
due to not forwarding the argument. Also add a test for the untested warning.
Also use a simpler method for forwarding the flag to cc1.
DeltaFile
+14-0clang/test/Frontend/openmp-warn-gpu-max-threads-per-block.c
+2-8clang/lib/Driver/ToolChains/AMDGPU.cpp
+6-0clang/test/Driver/amdgpu-openmp-gpu-max-threads-per-block.c
+22-83 files

LLVM/project 4e43cd6llvm/lib/Target/RISCV RISCVTargetTransformInfo.h, llvm/test/Transforms/LoopVectorize/RISCV reductions.ll

[LV][RISCV] Enable FSub reduction for scalable VFs (#207698)

#197134 introduced a change to FAdd reduction recognition, causing fsub
instructions to be classified as FSub reductions instead of FAdd
reductions. This patch fixes the regression by enabling FSub reduction
support for scalable VFs in TTI.
DeltaFile
+66-21llvm/test/Transforms/LoopVectorize/RISCV/reductions.ll
+1-0llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
+67-212 files

LLVM/project adc3969llvm/lib/Target/AMDGPU AMDGPUISelLowering.cpp SIISelLowering.cpp

[AMDGPU] Use APFloat::getOne instead of parsing "1.0" (NFC) (#207916)
DeltaFile
+1-1llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+1-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+2-22 files

LLVM/project ff51870llvm/lib/Target/Hexagon HexagonPatterns.td, llvm/test/CodeGen/Hexagon sext-mul-splat-v2i16.ll

[Hexagon] Optimize sext + mul pattern for splatted scalar sext i16 (#206893)

Extend the existing vmpyh pattern to handle the case where one operand
of a v2i32 nsw mul is a splatted scalar sext i16 value. When the splat
is hoisted out of a loop, it arrives as assertsext v2i32, i16 in the DAG
rather than sext v2i16. The existing pattern did not match this form,
causing the multiply to expand to two scalar mpyi instructions.

Add a PatFrag assertsext_v2i32_i16 to match assertsext nodes of type
v2i32 extended from i16, and two new patterns (both operand orderings)
that recover the v2i16 using A2_combine_ll before feeding into
M2_vmpy2s_s0.
DeltaFile
+31-0llvm/test/CodeGen/Hexagon/sext-mul-splat-v2i16.ll
+22-0llvm/lib/Target/Hexagon/HexagonPatterns.td
+53-02 files

LLVM/project 64df722llvm/lib/Target/AArch64 AArch64SchedC1Nano.td

[AArch64] C1-Nano scheduler cleanup in preparation for SME [NFC] (#207738)

Change are in preparation for a forthcoming addition of SME to the
C1-Nano scheduling model. This is restructuring of the code which does
not involve the actual SME changes. By separating out these NFC changes
it will make review of the SME specific changes easier.

- Defined resource names to match the form now used in the C1-Ultra
scheduling model which has the throughput information on the end of the
name rather than in the middle:

    C1NanoWrite_1c_1r_2ALU => C1NanoWrite_1c_2ALU_1rc

- Moved definitions so that they more closely match the order they are
defined in the C1-Nano SWOG. This make it easier to match entries in the
code to the tables in the SWOG.

These changes also make the C1-Nano scheduling model more closely match
the forms and layout used in the C1-Ultra scheduling model.
DeltaFile
+1,268-939llvm/lib/Target/AArch64/AArch64SchedC1Nano.td
+1,268-9391 files

LLVM/project 70646ddclang/docs ReleaseNotes.md, clang/lib/AST StmtPrinter.cpp

[clang][AST] Qualify DeclRefExpr printing (#206041)

I updated DeclRefExpr printing so fully-qualified printing consistently
uses declaration ownership rather than only the written qualifier. This
also preserves existing behavior for local names and cleaned parameter
names.
The added tests cover both the direct expression printer behavior and
the original type-printing scenario that exposed the missing
qualification.

Fixes #205925
DeltaFile
+40-33clang/lib/AST/StmtPrinter.cpp
+43-0clang/unittests/AST/StmtPrinterTest.cpp
+24-0clang/unittests/AST/TypePrinterTest.cpp
+4-0clang/docs/ReleaseNotes.md
+111-334 files

LLVM/project 36e81b8llvm/lib/Target/SPIRV SPIRVUtils.cpp SPIRVUtils.h

[NFC][SPIRV] Remove dead helper
DeltaFile
+0-9llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+0-2llvm/lib/Target/SPIRV/SPIRVUtils.h
+0-112 files

LLVM/project 70cc03fclang/lib/Driver/ToolChains AMDGPU.cpp HIPAMD.cpp

clang/AMDGPU: Merge toolchain subclasses

Simplify the toolchain implementations by collapsing
them into one. Previously we had a confusing split. The
AMDGPUToolChain base class implemented much of the base
support. It was subclassed by ROCMToolChain, which would
have been more accurately described as the offloading subclass.

That was further subclassed into HIP and OpenMP specific subclasses.
Deleting those two is the important part of this change. There was
code duplication, and features arbitrarily handled in one but not
the other. The offload kind is passed in almost everywhere if you
really need to know the original language. However, I consider
this an antifeature, and it is really poor QoI to have the HIP
and OpenMP toolchains behave differently in any way. The platform
should be consistent and the driver behaviors should not depend
on the language.

There is additional mess in the handling of spirv, which this

    [9 lines not shown]
DeltaFile
+272-125clang/lib/Driver/ToolChains/AMDGPU.cpp
+2-202clang/lib/Driver/ToolChains/HIPAMD.cpp
+0-94clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
+48-23clang/lib/Driver/ToolChains/AMDGPU.h
+0-68clang/lib/Driver/ToolChains/AMDGPUOpenMP.h
+1-50clang/lib/Driver/ToolChains/HIPAMD.h
+323-5624 files not shown
+348-57710 files