LLVM/project 8ba3300libsycl/src/detail device_image_wrapper.cpp, offload/liboffload/src OffloadImpl.cpp

[offload][sycl] add context parameter to olCreateProgram (#218387)

This patch is the 3rd patch in the context patch series. This change is
relatively simple compared to the others: we just introduce context to
the create program API and pass it down through the plugin interface to
the plugins.
DeltaFile
+37-13offload/unittests/OffloadAPI/program/olCreateProgram.cpp
+16-4offload/plugins-nextgen/level_zero/include/L0Program.h
+12-6offload/liboffload/src/OffloadImpl.cpp
+8-7offload/plugins-nextgen/level_zero/include/L0Device.h
+8-4libsycl/src/detail/device_image_wrapper.cpp
+7-3offload/plugins-nextgen/level_zero/src/L0Device.cpp
+88-3721 files not shown
+151-7327 files

LLVM/project b123e95llvm/lib/Target/AMDGPU AMDGPU.td

AMDGPU: Add visible features for aperture regs, doorbell ID and AGPR alloc

These fields are needed to migrate AMDGPUAttributor to using TargetParser
information instead of subtarget features.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+21-6llvm/lib/Target/AMDGPU/AMDGPU.td
+21-61 files

LLVM/project 87d449fllvm/lib/Transforms/InstCombine InstCombineCompares.cpp, llvm/test/Transforms/InstCombine icmp.ll

[InstCombine] Do not apply unsigned sub identities when flipping icmp strictness in `foldICmpBinOp` (#219904)

Folding `icmp ult A -nuw B, Op1 -> icmp ule A, Op1` may be unsound for
unsigned predicates with negative B, when the subtraction appears as a
`or disjoint`, previously matched as `add nuw`. nuw in `A + (-B)`
ensures that `A <u B` does not wrap unsigned, though the identity would
require proving `A >=u B` for the subtraction not to wrap. As the fold
relies on `NoOp0WrapProblem`, which proves the opposite of the latter,
simply avoid performing such an optimization.

Fixes: https://github.com/llvm/llvm-project/issues/218540.
DeltaFile
+44-0llvm/test/Transforms/InstCombine/icmp.ll
+13-6llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+57-62 files

LLVM/project d9d947fcompiler-rt/lib/sanitizer_common sanitizer_platform_limits_posix.h

Remove two declarations without definitions (#219511)

Commit 3dc4fd6d removed the definitions of struct_scc_modem_sz and
struct_scc_stat_sz, but left the declarations in a header. This patch
removes the leftovers.
DeltaFile
+0-2compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+0-21 files

LLVM/project f89861fllvm/lib/Target/SystemZ SystemZScheduleZ17.td

[SystemZ] Minor fixing in z17 SchedModel. (#219956)

A few insignificant updates to some opcodes.
DeltaFile
+3-4llvm/lib/Target/SystemZ/SystemZScheduleZ17.td
+3-41 files

LLVM/project 0b768f4clang/lib/Driver/ToolChains UEFI.cpp Solaris.cpp, clang/test/Driver fsanitize-undefined-device-offload.c

[Clang] Enable UBSan for AMDGPU device offload

Summary:
This enables the device UBSan runtime for AMDGPU decides. Primarily this
required modifications to the `addSanitizerRuntime` interface so we can
query the compilation's offload status. Also need to forward it through
the linker wrapper interface. Works on all AMDGPU offload, slight hacks
around the other targets as they do not advertise sanitizer
runtimes properly.

This is linked in via a new `-u __ubsan_device_initialize` hook to pull
in the side library. This is standard behavior and keeps the core logic
mostly unchanged and re-used.
DeltaFile
+50-0clang/test/Driver/fsanitize-undefined-device-offload.c
+32-3clang/lib/Driver/ToolChains/CommonArgs.cpp
+2-2clang/lib/Driver/ToolChains/Hexagon.cpp
+2-1clang/lib/Driver/ToolChains/Clang.cpp
+1-1clang/lib/Driver/ToolChains/UEFI.cpp
+1-1clang/lib/Driver/ToolChains/Solaris.cpp
+88-813 files not shown
+98-1819 files

LLVM/project 37f1ab4mlir/lib/Target/LLVMIR/Dialect/OpenMP OpenMPToLLVMIRTranslation.cpp, mlir/test/Target/LLVMIR openmp-todo.mlir openmp-target-launch-device.mlir

Update logic with initSentinel and padTrailingDims
DeltaFile
+39-19mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+23-4mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
+25-2mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
+0-11mlir/test/Target/LLVMIR/openmp-todo.mlir
+87-364 files

LLVM/project f7d8632llvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution max-backedge-taken-count-guard-info.ll

[SCEV] Apply loop guards to Distance + 1 in howFarToZero. (#219944)

Apply loop guards on on `Distance + 1` before computing the unsinged
range. This improves results in a number of cases in practice, mostly
additional unrolling and some runtime check simplifications:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1138

Guards have already been collected on this code path, so applying them
is cheap.
Compile-time impact is in the noise:
https://llvm-compile-time-tracker.com/compare.php?from=918aa38d750cd40d4265c39817fb31efb628f7e1&to=33c51ea1c4748883dfef71bdd1007bd72ec9095f&stat=instructions:u

PR: https://github.com/llvm/llvm-project/pull/219944
DeltaFile
+194-0llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
+1-14polly/test/ScopInfo/multidim_fortran_srem.ll
+7-3llvm/lib/Analysis/ScalarEvolution.cpp
+1-1llvm/test/Transforms/PhaseOrdering/constraint-eliminiation-interactions.ll
+203-184 files

LLVM/project 41af3cacompiler-rt/lib/ubsan/device ubsan_device_symbolize.cpp hsa.h

[compiler-rt] Add AMDGPU Device UndefinedBehaviorSanitizer runtime

Summary:
This adds support for full UBSan on the AMDGPU target. The GPU build of
`compiler-rt` will now build `libclang_rt.ubsan_standalone.a` and the
host build will now provide `libclang_rt.ubsan_device.a` for the
host-side formatting.

The **core** approach is to simply gather arguments from the device and
replay them on the host. The RPC interface acts as the narrow shim to
pass data between the CPU and GPU.

The changes to the core runtime are kept minimal, only exposing a few
needed hooks to re-run and symbolize reports coming from an external
caller. The device archive is a side-library which will only be present
for GPU offloading builds.

Putting this in `compiler-rt` via interceptors avoids an ABI edge
between many consumers, (OpenMP, HIP, Pytorch, etc). The runtime code is

    [42 lines not shown]
DeltaFile
+364-0compiler-rt/lib/ubsan/device/ubsan_device_hsa.cpp
+279-0compiler-rt/lib/ubsan/device/ubsan_device_report.cpp
+233-0compiler-rt/lib/ubsan/device/ubsan_device_rpc.cpp
+199-0compiler-rt/lib/ubsan/device/ubsan_device_hsa_interceptors.cpp
+172-0compiler-rt/lib/ubsan/device/hsa.h
+148-0compiler-rt/lib/ubsan/device/ubsan_device_symbolize.cpp
+1,395-032 files not shown
+2,406-7938 files

LLVM/project dee1f43llvm CMakeLists.txt

workflows/release-binaries: Smaller WiX installer on Windows (#219858)

Reduce WiX installer size by using LZX compression instead of MSZIP
previously. Tested on `release/23.x` at commit
fdf0409c656cc66c61b14d71c831f2b453c13e19 targetting Win64:

- MSZIP: 779 MiB
- LZX: 613 MiB
DeltaFile
+8-2llvm/CMakeLists.txt
+8-21 files

LLVM/project 834171cflang/include/flang/Semantics openmp-modifiers.h openmp-utils.h, flang/lib/Semantics check-omp-loop.cpp resolve-directives.cpp

[flang][OpenMP] Switch OpenMP version from unsigned to llvm::omp::Version

Also make llvm::omp::Version converting constructor/operstor explicit.
DeltaFile
+91-88flang/lib/Semantics/check-omp-structure.cpp
+20-18flang/include/flang/Semantics/openmp-utils.h
+18-17flang/lib/Semantics/openmp-utils.cpp
+10-10flang/include/flang/Semantics/openmp-modifiers.h
+7-7flang/lib/Semantics/resolve-directives.cpp
+6-6flang/lib/Semantics/check-omp-loop.cpp
+152-14621 files not shown
+218-20327 files

LLVM/project 44954a0llvm/utils/release build_llvm_release.bat

workflows/release-binaries: Ignore flaky test on Windows (#219859)

Skip a flaky test when building the Win64 LLVM package on Windows.

A popular security/antimalware solution is preventing this test from
completing correctly.
DeltaFile
+1-1llvm/utils/release/build_llvm_release.bat
+1-11 files

LLVM/project c95988dflang/include/flang/Semantics openmp-modifiers.h openmp-utils.h, flang/lib/Semantics check-omp-loop.cpp resolve-directives.cpp

[flang][OpenMP] Switch OpenMP version from unsigned to llvm::omp::Version

Also make llvm::omp::Version converting constructor/operstor explicit.
DeltaFile
+91-88flang/lib/Semantics/check-omp-structure.cpp
+20-18flang/include/flang/Semantics/openmp-utils.h
+18-17flang/lib/Semantics/openmp-utils.cpp
+10-10flang/include/flang/Semantics/openmp-modifiers.h
+7-7flang/lib/Semantics/resolve-directives.cpp
+6-6flang/lib/Semantics/check-omp-loop.cpp
+152-14621 files not shown
+220-20227 files

LLVM/project 242b02bclang/include/clang/AST OpenMPClause.h, clang/lib/AST DeclPrinter.cpp StmtPrinter.cpp

[clang][OpenMP] Switch OpenMP version from unsigned to llvm::omp::Version
DeltaFile
+61-58clang/lib/Sema/SemaOpenMP.cpp
+16-16clang/lib/Parse/ParseOpenMP.cpp
+6-9clang/lib/AST/StmtPrinter.cpp
+4-3clang/lib/Sema/TreeTransform.h
+3-3clang/lib/AST/DeclPrinter.cpp
+3-2clang/include/clang/AST/OpenMPClause.h
+93-912 files not shown
+98-928 files

LLVM/project 8cc3b26llvm/include/llvm/Frontend/OpenMP OMPDescriptors.h OMPVersion.h, llvm/lib/Frontend/OpenMP OMPDescriptors.inc

[OpenMP] Make OpenMP version have separate type

It's unsigned now. Giving it a separate type would make the code clearer,
and it would make it easier to change the effective type if it's ever
needed.
DeltaFile
+788-788llvm/lib/Frontend/OpenMP/OMPDescriptors.inc
+63-0llvm/include/llvm/Frontend/OpenMP/OMPVersion.h
+29-17llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+13-13llvm/test/TableGen/directive1.td
+12-12llvm/test/TableGen/directive2.td
+10-10llvm/include/llvm/Frontend/OpenMP/OMPDescriptors.h
+915-84011 files not shown
+975-88917 files

LLVM/project d977ba0compiler-rt/lib/ubsan/device ubsan_device_symbolize.cpp hsa.h

[compiler-rt] Add AMDGPU Device UndefinedBehaviorSanitizer runtime

Summary:
This adds support for full UBSan on the AMDGPU target. The GPU build of
`compiler-rt` will now build `libclang_rt.ubsan_standalone.a` and the
host build will now provide `libclang_rt.ubsan_device.a` for the
host-side formatting.

The **core** approach is to simply gather arguments from the device and
replay them on the host. The RPC interface acts as the narrow shim to
pass data between the CPU and GPU.

The changes to the core runtime are kept minimal, only exposing a few
needed hooks to re-run and symbolize reports coming from an external
caller. The device archive is a side-library which will only be present
for GPU offloading builds.

Putting this in `compiler-rt` via interceptors avoids an ABI edge
between many consumers, (OpenMP, HIP, Pytorch, etc). The runtime code is

    [42 lines not shown]
DeltaFile
+364-0compiler-rt/lib/ubsan/device/ubsan_device_hsa.cpp
+279-0compiler-rt/lib/ubsan/device/ubsan_device_report.cpp
+233-0compiler-rt/lib/ubsan/device/ubsan_device_rpc.cpp
+199-0compiler-rt/lib/ubsan/device/ubsan_device_hsa_interceptors.cpp
+172-0compiler-rt/lib/ubsan/device/hsa.h
+148-0compiler-rt/lib/ubsan/device/ubsan_device_symbolize.cpp
+1,395-031 files not shown
+2,405-7937 files

LLVM/project 332e973clang/include/clang/Driver CommonArgs.h, clang/lib/Driver/ToolChains AMDGPU.cpp Clang.cpp

[Clang] Enable UBSan for AMDGPU device offload

Summary:
This enables the device UBSan runtime for AMDGPU decides. Primarily this
required modifications to the `addSanitizerRuntime` interface so we can
query the compilation's offload status. Also need to forward it through
the linker wrapper interface. Works on all AMDGPU offload, slight hacks
around the other targets as they do not advertise sanitizer
runtimes properly.

This is linked in via a new `-u __ubsan_device_initialize` hook to pull
in the side library. This is standard behavior and keeps the core logic
mostly unchanged and re-used.
DeltaFile
+50-0clang/test/Driver/fsanitize-undefined-device-offload.c
+32-3clang/lib/Driver/ToolChains/CommonArgs.cpp
+2-2clang/lib/Driver/ToolChains/Hexagon.cpp
+2-1clang/lib/Driver/ToolChains/Clang.cpp
+1-1clang/lib/Driver/ToolChains/AMDGPU.cpp
+1-1clang/include/clang/Driver/CommonArgs.h
+88-812 files not shown
+97-1718 files

LLVM/project 187d01eclang/lib/Basic TargetID.cpp, clang/test/Driver amdgpu-offload-arch-subarch-names.c

clang/AMDGPU: Accept subarch names in --offload-arch (#219963)

Accept the triple subarch names as aliases. e.g.,
--offload=arch=amdgpu9.50 is equivalent to --offload-arch=gfx950
DeltaFile
+211-0clang/test/Driver/amdgpu-offload-arch-subarch-names.c
+15-3clang/lib/Basic/TargetID.cpp
+226-32 files

LLVM/project 54e586dllvm/lib/CodeGen MachineInstr.cpp

CodeGen: Use use_instructions in changeDebugValuesDefReg

The loop only inspects the using instruction, so iterate instructions
directly instead of operands and their parents.

Co-authored-by: Claude (Claude-Opus-4.8)
DeltaFile
+4-5llvm/lib/CodeGen/MachineInstr.cpp
+4-51 files

LLVM/project 1c15bbellvm/include/llvm/CodeGen TargetInstrInfo.h, llvm/lib/CodeGen Rematerializer.cpp CalcSpillWeights.cpp

CodeGen: Pass instruction and operand index to isIgnorableUse

Replace the MachineOperand argument to the TargetInstrInfo::isIgnorableUse
hook with the containing instruction and operand index. The AMDGPU
implementation only used the operand to recover its parent instruction, so
this drops the dependence on MachineOperand::getParent().

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+7-4llvm/lib/CodeGen/MachineSink.cpp
+7-4llvm/lib/CodeGen/MachineCSE.cpp
+3-3llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+3-3llvm/include/llvm/CodeGen/TargetInstrInfo.h
+2-1llvm/lib/CodeGen/Rematerializer.cpp
+2-1llvm/lib/CodeGen/CalcSpillWeights.cpp
+24-163 files not shown
+27-199 files

LLVM/project 6cfe429llvm/lib/CodeGen MachinePipeliner.cpp

MachinePipeliner: Pass instruction to findLoopIncrementValue

The helper recovered the loop block from the operand's parent instruction.
Pass the containing instruction directly so it no longer depends on
MachineOperand::getParent().

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+4-3llvm/lib/CodeGen/MachinePipeliner.cpp
+4-31 files

LLVM/project bf9fe77clang/lib/Driver/ToolChains CommonArgs.cpp, clang/test/Driver hip-cuid.hip amdgpu-xnack-sramecc-flags.c

clang/AMDGPU: Stop passing redundant -target-cpu to cc1 (#206483)

Now that the exact target is encoded in the triple's subarch field,
-target-cpu is redundant. This avoids polluting the resultant IR with
unwanted "target-cpu" attributes. The net result is the desired codegen
when compiling libraries for a major subarch and linking it into a
program compiled for a specific arch. e.g., compiling for "gfx9-generic"
would pollute the IR with "target-cpu"="gfx9-generic", so codegen
would ultimately be performed for the generic target even after
linking into the concrete gfx9 cpu. The specialization will now be
achieved by merging the triples without the linker or optimization
passes needing to fixup function attributes.
DeltaFile
+63-63clang/test/Driver/amdgpu-mcpu.cl
+26-26clang/test/Driver/hip-sanitize-options.hip
+12-16clang/test/Driver/hip-rdc-device-only.hip
+18-8clang/lib/Driver/ToolChains/CommonArgs.cpp
+10-10clang/test/Driver/amdgpu-xnack-sramecc-flags.c
+5-7clang/test/Driver/hip-cuid.hip
+134-13026 files not shown
+189-21032 files

LLVM/project 7c3d6c8clang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode] Avoid classify()ing logical binary operators (#219943)

We can just check `isBooleanType()` instead.
DeltaFile
+4-4clang/lib/AST/ByteCode/Compiler.cpp
+4-41 files

LLVM/project 09231edclang/docs ReleaseNotes.md, clang/lib/Analysis CFG.cpp

[clang] Delay dependent co_return promise calls (#218779)

Avoiding selection of return_value or return_void while building
co_return whose operand is type-dependent and keeping it unset until
template init rebuild for a type allows dependent operations like
co_return ctx.f(v) to use promise.return_void() instead of needing
promise.return_value().

Fixes #218368
DeltaFile
+26-0clang/test/SemaCXX/coreturn.cpp
+7-0clang/lib/Sema/SemaCoroutine.cpp
+3-2clang/lib/Analysis/CFG.cpp
+4-0clang/docs/ReleaseNotes.md
+40-24 files

LLVM/project 6d390eaclang/lib/Format UnwrappedLineFormatter.cpp, clang/unittests/Format FormatTestJava.cpp

  [clang-format] Keep empty Java interface/record body on one line (#219910)

`AllowShortRecordOnASingleLine` (introduced for C++ records) made
  `LineJoiner::tryFitMultipleLinesInOne` route Java `TT_RecordLBrace`
  lines to `tryMergeRecord`, which only handles C++ class/struct/union
  records. Empty Java `interface` and `record` bodies were therefore no
  longer merged onto a single line, regressing the behavior that
  `BraceWrapping.SplitEmptyRecord: false` previously provided.

  Handle Java records separately and restore the pre-existing
  `SplitEmptyRecord`-based merge.

  Fixes #219711
DeltaFile
+7-2clang/lib/Format/UnwrappedLineFormatter.cpp
+7-0clang/unittests/Format/FormatTestJava.cpp
+14-22 files

LLVM/project 485ed43clang/lib/Basic TargetID.cpp, clang/test/Driver amdgpu-offload-arch-subarch-names.c

clang/AMDGPU: Accept subarch names in --offload-arch

Accept the triple subarch names as aliases. e.g.,
--offload=arch=amdgpu9.50 is equivalent to --offload-arch=gfx950
DeltaFile
+211-0clang/test/Driver/amdgpu-offload-arch-subarch-names.c
+15-3clang/lib/Basic/TargetID.cpp
+226-32 files

LLVM/project f9c6626llvm/lib/AsmParser Parser.cpp LLParser.cpp, llvm/lib/CodeGen/MIRParser MIRParser.cpp MIParser.cpp

[MIR] Round-trip all machine metadata nodes (#219612)

MIR only emitted definitions for a subset of metadata referenced by
machine
functions. Other nodes were printed as pointer values and could not be
parsed
back.

Collect metadata referenced by machine instructions, memory operands,
and
variable debug information. Keep debug locations inline so the output
remains
readable.

Parse each machine metadata item with LLVM IR's metadata parser while
preserving the YAML item boundaries. This supports specialized nodes,
cycles,
and forward references without accepting definitions split across list
items,
and removes the old tuple-only parser.
DeltaFile
+0-153llvm/lib/CodeGen/MIRParser/MIParser.cpp
+83-0llvm/lib/AsmParser/LLParser.cpp
+49-0llvm/lib/AsmParser/Parser.cpp
+20-18llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+38-0llvm/test/CodeGen/MIR/X86/machine-metadata-specialized.mir
+35-0llvm/test/CodeGen/MIR/X86/machine-metadata-round-trip.mir
+225-17119 files not shown
+348-18725 files

LLVM/project 997e4eeclang/docs LibASTMatchers.md

[docs] Remove stale FIXMEs in LibASTMatchers.md (#219741)

Replace the stale "Introduce link to ASTMatchersTutorial.html" FIXMEs
with a link to the existing LibASTMatchersTutorial, drop the
ASTMatchersCookbook FIXMEs (no cookbook exists), and fix the "macros
(see below)" reference which should point to the AST_MATCHER_P section
above.
DeltaFile
+3-12clang/docs/LibASTMatchers.md
+3-121 files

LLVM/project f95911cllvm/lib/Target/AMDGPU SILoadStoreOptimizer.cpp, llvm/test/CodeGen/AMDGPU merge-image-load-gfx11.mir merge-image-load-gfx10.mir

[AMDGPU] Reject image load merges with mismatched dim (#219923)

dim was missing from the operand equality check, so loads with different
dim could wrongly get merged into one
DeltaFile
+90-0llvm/test/CodeGen/AMDGPU/merge-image-load-dim.ll
+20-0llvm/test/CodeGen/AMDGPU/merge-image-load-gfx12.mir
+18-0llvm/test/CodeGen/AMDGPU/merge-image-load-gfx11.mir
+18-0llvm/test/CodeGen/AMDGPU/merge-image-load-gfx10.mir
+2-1llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+148-15 files

LLVM/project faab176llvm/test/tools/llvm-reduce reduce-flags.ll, llvm/tools/llvm-reduce ReducerWorkItem.cpp

llvm-reduce: Handle the addrspacecast nonnull flag

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+24-0llvm/test/tools/llvm-reduce/reduce-flags.ll
+3-0llvm/tools/llvm-reduce/deltas/ReduceInstructionFlags.cpp
+3-0llvm/tools/llvm-reduce/ReducerWorkItem.cpp
+30-03 files