LLVM/project 0d91c10lldb/source/Plugins/Process/gdb-remote ProcessGDBRemote.h ProcessGDBRemote.cpp

[lldb] Fix use-after-free in jThreadsInfo stop info cache (#223488)

WillPublicStop iterates over the array borrowed from m_jthreadsinfo_sp
while WillResume concurrently resets the pointer on another thread,
freeing the array during the walk.

Protect the cached stop info with a mutex and copy the shared pointer
out before processing. Also modernize m_shared_cache_info to Guarded.

rdar://186776438
DeltaFile
+25-20lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+14-8lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+39-282 files

LLVM/project 45c113dbolt/runtime common.h instr.cpp

[BOLT][AArch64] Make Android instrumentation runtime fail safe (#223110)

Profiling failure in BOLT instrumentation runtime should not kill the
host app on Android. Under `ANDROID_AARCH64`, we now handle failures
in instrumentation setup, memory allocation, hash table operations,
data dumping, opening profile output file, zero-counter binary, etc..
Since the first failure, we will disable profiling and directly return
from various instrumentation entry points, instead of assert/exit.

Only for Android AArch64; the behavior is unchanged otherwise.
DeltaFile
+231-38bolt/runtime/instr.cpp
+6-2bolt/runtime/common.h
+237-402 files

LLVM/project 86dfc32clang/lib/CIR/CodeGen CIRGenAtomic.cpp, clang/test/CIR/CodeGen atomic-libcall.c

[CIR] Atomic compare-and-exchange via libcall (#206073)

This patch adds support for atomic compare-and-exchange operations via libcall.

Assisted-by: Codex / gpt-5.5 xhigh
DeltaFile
+87-9clang/test/CIR/CodeGen/atomic-libcall.c
+22-8clang/lib/CIR/CodeGen/CIRGenAtomic.cpp
+109-172 files

LLVM/project 816a2ecllvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp, llvm/lib/MC GOFFObjectWriter.cpp MCSymbolGOFF.cpp

[SystemZ][z/OS] Add AMODE to PR symbols

Contrary to the documentation, setting the AMODE at PR symbols is
required. The symptom is that references to variables `optind` and
`optarg` (from include `<getopt.h>`, the LE-provided C runtime)
results in "missing symbol" errors.
Fix is to add AMODE to PrAttr, analog to LdAttr.
DeltaFile
+11-11llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+10-10llvm/lib/MC/MCObjectFileInfo.cpp
+5-5llvm/lib/MC/MCSymbolGOFF.cpp
+3-2llvm/lib/MC/GOFFObjectWriter.cpp
+2-2llvm/test/CodeGen/SystemZ/zos-section-2.ll
+1-1llvm/test/tools/llvm-ar/zos-symattrs.test
+32-313 files not shown
+35-339 files

LLVM/project 5cc8a51clang/lib/CIR/CodeGen CIRGenModule.cpp, clang/test/CIR/CodeGen forward-decls.cpp

[CIR] Fix 'isConstant' calc when looking at an incomplete type (#223444)

This popped up in a benchmark. Classic codegen ALWAYS sets this as
'excludeCtor'/'excludeDtor', but CIR tried 'harder' to get this right.
However, with an incomplete type, we can't actually look into it to see
if it has any mutable members, so determining 'constness' isn't
possible.

We could PROBABLY do better with enums since I would assume they can be
constant most of the time, but we fall-back to classic-codegen's
behavior here instead: which marks it as non-const.

Thanks to 'trying harder' than classic codegen as mentioned above, there
IS a slight LLVM-IR difference, but for the better.

Also note: Claude helped me with the tests.
DeltaFile
+58-0clang/test/CIR/CodeGen/forward-decls.cpp
+11-2clang/lib/CIR/CodeGen/CIRGenModule.cpp
+69-22 files

LLVM/project 7cd7403llvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-promote.ll

Count the intrinsics that really become calls when refusing promotion
DeltaFile
+81-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-promote.ll
+43-36llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+124-362 files

LLVM/project 4431b00llvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-promote.ll

Carry null operands and intrinsic names across when promoting to VGPRs
DeltaFile
+145-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-promote.ll
+42-2llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+187-22 files

LLVM/project 4844276llvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-promote.ll

Refuse promotion only when the object is live across a call
DeltaFile
+183-4llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-promote.ll
+117-15llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+300-192 files

LLVM/project af63511llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.h AMDGPUMemoryUtils.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-promote.ll

Promote private objects into the VGPR address space via flag
DeltaFile
+279-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-promote.ll
+138-3llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+1-27llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+19-0llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+16-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+453-315 files

LLVM/project 54f808ellvm/lib/Target/AMDGPU AMDGPUMachineInstrs.h SIInstructions.td, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-private-object-vgprs.mir

Propagate object liveness to every changed successor, not only back edges
DeltaFile
+30-44llvm/lib/Target/AMDGPU/AMDGPUPrivateObjectVGPRs.cpp
+25-34llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+56-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-private-object-vgprs.mir
+7-12llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+4-8llvm/lib/Target/AMDGPU/SIInstructions.td
+3-4llvm/lib/Target/AMDGPU/AMDGPUMachineInstrs.h
+125-1026 files

LLVM/project 35d553butils/bazel/llvm-project-overlay/libc BUILD.bazel

[Bazel] Fixes 52b2e03 (#223567)

This fixes 52b2e03278f103f5baaa14a43bd9be380301de94 (#220906).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=52b2e03278f103f5baaa14a43bd9be380301de94

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+10-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+10-11 files

LLVM/project 37d9648llvm/include/llvm/CodeGen SelectionDAG.h

[NFC] [SelectionDAG] fix typo in comment (#223560)
DeltaFile
+2-2llvm/include/llvm/CodeGen/SelectionDAG.h
+2-21 files

LLVM/project 52b2e03libc/src/__support/File file.cpp file.h, libc/src/__support/File/linux file_flags.h file.cpp

[libc] feat(filemode): implement class and helper functions to handle file modes for an opened file (#220906)

I moved the logic from `mode_flags` function to the `FileMode`
constructor.

The `FileMode` class has several helper methods to work with modes which
can then be called in `File` class.

Issue: #213374

---------

Signed-off-by: tdadadavid <davidtofunmidada at gmail.com>
Co-authored-by: Michael Jones <michaelrj at google.com>
DeltaFile
+222-0libc/test/src/__support/File/file_mode_test.cpp
+152-0libc/src/__support/File/file_mode.h
+56-81libc/src/__support/File/linux/file.cpp
+8-43libc/src/__support/File/file.h
+49-0libc/src/__support/File/linux/file_flags.h
+0-45libc/src/__support/File/file.cpp
+487-1699 files not shown
+533-19815 files

LLVM/project a636e92llvm/lib/Target/RISCV RISCVOptWInstrs.cpp, llvm/test/CodeGen/RISCV opt-w-instrs.mir

[RISCV] Teach RISCVOptWInstrs that zext.w is fixable to sext.w. (#223559)

Note, in some cases erasing the zext.w and fixing an earlier
instruction would be even better but that requires more extensive
changes.
DeltaFile
+28-0llvm/test/CodeGen/RISCV/opt-w-instrs.mir
+22-1llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp
+50-12 files

LLVM/project 54f5766mlir/lib/Conversion/AMDGPUToROCDL AMDGPUToROCDL.cpp, mlir/lib/Conversion/GPUToROCDL LowerGpuOpsToROCDLOps.cpp

[mlir] Migrate AMDGPU/ROCDL to targets, not chipset versions

**migration tl;dr:** Replace usages of `amdgpu::Chipset` with `ROCDL::TargetInfo`, ideally move from `chipset=` to `arch=`. If you don't use upstream pipelines, call 'TargetInfo::migrateArchFeaturesToModuleFlags` at the appropriate location.

Further note: if you've got a build pipeline that's getting a `gfxXXX` name from something like `rocm_agent_enumerator`, using a full triple name like the ones you get from `rocminfo` is preferred.

`amdgpu::Chipset` was an awkward hack that was hard to keep up to date
with changes in the compiler/new architectures, and didn't properly
support generic targets (and has been strongly disfavored by the
compiler team).

This PR replaces `amdgpu::Chipset` with `ROCDL::TargetInfo`, a
structure that uses LLVM's TargetParser and the underlying LLVM
features tables to get the real nature of the target being compiled
for.

This also helps MLIR move to
new-style (`-mtriple=amdgpuX.YZ-amd-amdhsa`) over "old
style" (`-mtriple=amdgcn-amd-amdhsa -mcpu=gfxXYZ`) triples.

    [36 lines not shown]
DeltaFile
+316-323mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
+105-0mlir/test/Dialect/LLVMIR/rocdl-attach-target-arch.mlir
+87-4mlir/lib/Dialect/GPU/Transforms/ROCDLAttachTarget.cpp
+46-40mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp
+49-24mlir/test/Dialect/AMDGPU/amdgpu-emulate-atomics.mlir
+30-30mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
+633-421103 files not shown
+1,181-718109 files

LLVM/project efd75a6mlir/include/mlir/Dialect/LLVMIR ROCDLTargetInfo.h, mlir/lib/Dialect/LLVMIR CMakeLists.txt

[mlir][ROCDL] Add TargetInfo to replace Chipset, allow features queries

Add a now ROCDL::TargetInfo struct that parses AMDGPU triples and
target names using the same logic that Clang and LLVM
use (TargetParser) and maintains the set of features available on a
given GPU.

This is an improvement over the old `amdgpu::Chipset` struct since
that was just a version number and often became stale compared to the
knowledge exposed by LLVM, such as gfx1170 having OCP FP8 support even
though other gfx11 chips don't have it.

This struct also allows for moving to new-style
triples (amdgpu9.42-amd-amdhsa vs amdgcn-amd-amdhsa--gfx942, for
example), which is an ongoing migration in other parts of the compiler
that this PR lets us follow.

It also enables compiling for generic targets, like `gfx11-generic`,
which can be run on all chips in a generation.

    [15 lines not shown]
DeltaFile
+392-0mlir/unittests/Dialect/LLVMIR/ROCDLTargetInfoTest.cpp
+242-0mlir/lib/Dialect/LLVMIR/IR/ROCDLTargetInfo.cpp
+193-0mlir/include/mlir/Dialect/LLVMIR/ROCDLTargetInfo.h
+2-0mlir/unittests/Dialect/LLVMIR/CMakeLists.txt
+2-0mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+831-05 files

LLVM/project b984140clang/test/CodeGen link-builtin-bitcode.c, flang/test/Lower/OpenMP target_cpu_features.f90

[AMDGPU] Expose more subtarget features for MLIR

- `FeatureAtomitFaddNoRtnInsts` is needed to control when atomic emulation
for buffer operations happens
- `FeatureBackOffBarrier` controls an inline-assembly workaround for
LDS-only barriers on old gfx9
- `FeatureLfsBarrierArriveAtomic` is a precise flag compared to arch versions
- `FeatureORPFP8ConversionInsts` controls which MLIR FP8 types can be
lowered to LLVM
- `FeaturePermlane16Insts`is another feature check

Clang and flang tests are updated since they look at the feature set

AI disclosure: Claude made these changes, I wrote this message
DeltaFile
+8-6llvm/lib/Target/AMDGPU/AMDGPU.td
+3-3clang/test/CodeGen/link-builtin-bitcode.c
+1-1flang/test/Lower/OpenMP/target_cpu_features.f90
+12-103 files

LLVM/project 0822f66llvm/lib/Target/AMDGPU AMDGPUPrivateObjectVGPRs.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-asm-clobber.ll

Diagnose inline asm that clobbers a VGPR-memory object's registers
DeltaFile
+93-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-asm-clobber.ll
+31-5llvm/lib/Target/AMDGPU/AMDGPUPrivateObjectVGPRs.cpp
+124-52 files

LLVM/project e8092d6llvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp AMDGPUPrivateObjectVGPRs.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-across-call.ll as-vgpr-private-object-vgprs.mir

Allocate and reserve registers for address space 13 objects
DeltaFile
+340-0llvm/lib/Target/AMDGPU/AMDGPUPrivateObjectVGPRs.cpp
+178-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-object-regalloc.ll
+140-12llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+133-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-allocate.ll
+106-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-private-object-vgprs.mir
+80-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-across-call.ll
+977-1218 files not shown
+1,280-2324 files

LLVM/project 6a8b27bllvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-budget.ll

Diagnose an object that does not fit the function's register budget
DeltaFile
+82-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-budget.ll
+36-13llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+118-132 files

LLVM/project f7091b7llvm/lib/Target/AMDGPU AMDGPUPromoteAlloca.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-allocate.ll as-vgpr-across-call.ll

Do not add a second lifetime start when allocating VGPRs again
DeltaFile
+21-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-across-call.ll
+17-3llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
+0-1llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-allocate.ll
+38-43 files

LLVM/project 5e3edb4llvm/lib/Target/AMDGPU SIInstrInfo.cpp AMDGPUTargetMachine.cpp

Set up M0 for sub-dword VGPR-memory accesses in the custom inserter
DeltaFile
+9-11llvm/lib/Target/AMDGPU/AMDGPULowerIdxOps.cpp
+5-9llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+7-6llvm/lib/Target/AMDGPU/SIInstructions.td
+3-7llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+3-5llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+3-4llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+30-426 files

LLVM/project 87afb37llvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution trip-count-stride-positive-from-guard.ll

[ScalarEvolution] howManyLessThans infer stride isPositive from guard (#214014)

Infer Stride is positive from loop guard.
This enables SCEV to compute symbolic-max backedge-taken count for
multi-exit loops.

Motivating example:

  void example(int *p, int n, int stride, int bound) {
if (stride <= 0) __builtin_trap(); // dominating guard => stride > 0
    for (int i = 0; i < n; i += stride) {
if (i > bound) __builtin_trap(); // per-iteration bounds check (2nd
exit)
      p[i] = 0;
    }
  }
DeltaFile
+117-0llvm/test/Analysis/ScalarEvolution/trip-count-stride-positive-from-guard.ll
+52-0llvm/test/Transforms/IndVarSimplify/exit-value-guarded-positive-stride.ll
+14-3llvm/lib/Analysis/ScalarEvolution.cpp
+183-33 files

LLVM/project 4ae3c05clang/lib/CIR/CodeGen CIRGenBuiltinAMDGPU.cpp, clang/test/CIR/CodeGenHIP builtins-amdgcn-gfx1250.hip builtins-amdgcn-gfx950.hip

[CIR][AMDGPU] Add support for AMDGCN bitop3 builtins (#223104)

Adds codegen for the following AMDGCN bitop3 builtins:

- __builtin_amdgcn_bitop3_b32
- __builtin_amdgcn_bitop3_b16

These are lowered to the corresponding `llvm.amdgcn.bitop3` intrinsic.
DeltaFile
+33-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx950.hip
+19-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx1250.hip
+3-6clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+55-63 files

LLVM/project cbab1d5llvm/lib/Target/AMDGPU AMDGPUTargetTransformInfo.cpp, llvm/test/Analysis/CostModel/AMDGPU fptoui.ll fptosi.ll

[AMDGPU] Model the cost of the expanded integer to/from floating point casts

No instruction converts to or from a 64 bit integer, and narrow vector
lanes are converted one at a time. Price these expansions by the FP64
rate, sdwa and 16 bit instruction support, and price i33 to i63 like
i64 and bf16 like f32 plus rounding.

Assisted-by: Claude Code Opus 5
DeltaFile
+312-215llvm/test/Analysis/CostModel/AMDGPU/cast.ll
+196-110llvm/test/Analysis/CostModel/AMDGPU/expanded-int-fp-casts.ll
+107-0llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+60-37llvm/test/Analysis/CostModel/AMDGPU/fptoui.ll
+60-37llvm/test/Analysis/CostModel/AMDGPU/fptosi.ll
+735-3995 files

LLVM/project da8d3b7clang/test/AST/HLSL Textures-AST.hlsl Textures-vector-AST.hlsl, clang/test/CodeGenHLSL/resources Textures-Subscript.hlsl Textures-SampleGrad.hlsl

[HLSL] Implement Texture1D and its variants (#221061)

Fixes https://github.com/llvm/llvm-project/issues/194738
Fixes https://github.com/llvm/llvm-project/issues/194741
Fixes https://github.com/llvm/llvm-project/issues/194943
Fixes https://github.com/llvm/llvm-project/issues/194945

This PR implements the Texture1D type and its variants: RWTexture1D,
Texture1DArray, and RWTexture1DArray.

It also implements the codegen for the texture builtins so that they can
handle scalars where they otherwise always assumed a vector before the
existence of 1D textures.

Assisted by: Claude Opus 5

---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
DeltaFile
+294-161clang/test/CodeGenHLSL/resources/Textures-Load.hlsl
+224-181clang/test/AST/HLSL/Textures-vector-AST.hlsl
+224-181clang/test/AST/HLSL/Textures-scalar-AST.hlsl
+199-118clang/test/CodeGenHLSL/resources/Textures-SampleGrad.hlsl
+189-116clang/test/CodeGenHLSL/resources/Textures-Subscript.hlsl
+180-115clang/test/AST/HLSL/Textures-AST.hlsl
+1,310-87228 files not shown
+2,806-1,63934 files

LLVM/project 6fb04b6llvm/lib/Target/RISCV RISCVInstrInfoZb.td, llvm/test/CodeGen/RISCV rv64zbkb.ll

[RISCV] Add SRLI+PACK pattern for (or (and rs1, 0xffffffff), (and rs2, 0xffffffff00000000)). (#223507)

Fixes #223455.
DeltaFile
+22-0llvm/test/CodeGen/RISCV/rv64zbkb.ll
+5-1llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
+27-12 files

LLVM/project 0efe725llvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp, llvm/lib/MC GOFFObjectWriter.cpp MCSymbolGOFF.cpp

[SystemZ][z/OS] Add AMODE to PR symbols

Contrary to the documentation, setting the AMODE at PR symbols is
required. The symptom is that references to variables `optind` and
`optarg` (from include `<getopt.h>`, the LE-provided C runtime)
results in "missing symbol" errors.
Fix is to add AMODE to PrAttr, analog to LdAttr.
DeltaFile
+11-11llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+10-10llvm/lib/MC/MCObjectFileInfo.cpp
+5-5llvm/lib/MC/MCSymbolGOFF.cpp
+3-2llvm/lib/MC/GOFFObjectWriter.cpp
+2-2llvm/test/CodeGen/SystemZ/zos-section-2.ll
+1-1llvm/test/CodeGen/SystemZ/zos-symbol-2.ll
+32-312 files not shown
+34-328 files

LLVM/project 5929374llvm/unittests/Target/AMDGPU VGPRAsMemory.cpp

Pin the width guard that keeps sub-dword accesses out of aliasing decisions
DeltaFile
+70-0llvm/unittests/Target/AMDGPU/VGPRAsMemory.cpp
+70-01 files

LLVM/project dce07fdllvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-divergent.ll

Treat a sub-dword VGPR-memory load as divergent too
DeltaFile
+83-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-divergent.ll
+2-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+85-12 files