LLVM/project b093c48llvm/include/llvm/IR Instruction.h, llvm/lib/Transforms/InstCombine InstructionCombining.cpp

Remove clearSubclassOptionalData

Created using spr 1.3.8-wip
DeltaFile
+14-25llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+1-3llvm/lib/Transforms/Scalar/Reassociate.cpp
+0-3llvm/include/llvm/IR/Instruction.h
+1-1llvm/lib/Transforms/Utils/Local.cpp
+16-324 files

LLVM/project 30ec1faclang/lib/AST/ByteCode Compiler.cpp, clang/test/AST/ByteCode invalid.cpp

[clang][bytecode] Reject invalid UnaryOperators (#200394)
DeltaFile
+10-0clang/test/AST/ByteCode/invalid.cpp
+3-0clang/lib/AST/ByteCode/Compiler.cpp
+13-02 files

LLVM/project 3c95dd2llvm/lib/Transforms/Vectorize VPlanAnalysis.cpp VPlan.h

[VPlan] Thread scalar type through VPBlend, VPExpression recipes. (NFC) (#200255)

Set the scalar type for VPBlendRecipe and VPExpressionRecipe at
construction time, instead of inferring it on demand via VPTypeAnalysis.
With this change, all VPValues have their scalar type set at
construction, so VPTypeAnalysis::inferScalarType becomes a thin wrapper
around VPValue::getScalarType.

To be removed in a follow-up:
https://github.com/llvm/llvm-project/pull/200256.

PR: https://github.com/llvm/llvm-project/pull/200255
DeltaFile
+3-41llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+5-3llvm/lib/Transforms/Vectorize/VPlan.h
+4-1llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+4-0llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+0-3llvm/lib/Transforms/Vectorize/VPlanAnalysis.h
+16-485 files

LLVM/project e2106aellvm/include/llvm/IR DerivedTypes.h Type.h, llvm/lib/IR Use.cpp

more out of line

Created using spr 1.3.8-wip
DeltaFile
+8-0llvm/include/llvm/IR/DerivedTypes.h
+2-6llvm/include/llvm/IR/Type.h
+1-0llvm/lib/IR/Use.cpp
+11-63 files

LLVM/project 2501cddllvm/test/CodeGen/X86 vector-shuffle-combining-avx512vbmi2.ll

[X86] Add VBMI2 shuffle test to track miscompile reported in #200136 (#200569)
DeltaFile
+16-0llvm/test/CodeGen/X86/vector-shuffle-combining-avx512vbmi2.ll
+16-01 files

LLVM/project d46e7dcclang/lib/AST/ByteCode Interp.h, clang/test/AST/ByteCode c.c

[clang][bytecode] Fix an assertion failure in AddSubNonNumber (#200393)

Calling Integral::getPtr() shouldn't happen for AddrLabelDiff integrals.
DeltaFile
+8-0clang/test/AST/ByteCode/c.c
+6-0clang/lib/AST/ByteCode/Interp.h
+14-02 files

LLVM/project 9bface9llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-load-global.mir

Rebase

Created using spr 1.3.7
DeltaFile
+5,590-5,510llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+10,469-10llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+2,241-2,241llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/arithmetic.test
+1,831-1,831llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/fp.test
+1,541-1,541llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/vlseg-vsseg.test
+1,417-1,417llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/bitwise.test
+23,089-12,5501,766 files not shown
+94,758-51,3441,772 files

LLVM/project 71bcffallvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-load-global.mir

Rebase

Created using spr 1.3.7
DeltaFile
+5,590-5,510llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+10,469-10llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-load-global.mir
+2,241-2,241llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/arithmetic.test
+1,831-1,831llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/fp.test
+1,541-1,541llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/vlseg-vsseg.test
+1,417-1,417llvm/test/tools/llvm-mca/RISCV/SiFiveP400/rvv/bitwise.test
+23,089-12,5501,206 files not shown
+81,459-42,2151,212 files

LLVM/project 8d86dc2llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 lcssa-phi-extract-scale.ll

[SLP] Fix extract-cost scale using NCD of all external-user sites

ExtractCostCalculated deduplicates by scalar so only the first
ExternalUser determines the scale, making the cost depend on IR block
ordering via LLVM's reverse-insertion use-list order.
Add a pre-pass computing ScalarToExtractBlock - the nearest common
dominator of all effective extract sites per scalar. For PHI users inside
a loop the effective site is the incoming block; for PHI users outside
all loops it is the PHI's own block (scale = 1). The extract cost is
then scaled by getLoopNestScale of the NCD block, which is fully
order-independent.

Fixes #199548

Reviewers: bababuck, RKSimon, hiraditya

Pull Request: https://github.com/llvm/llvm-project/pull/199962
DeltaFile
+66-44llvm/test/Transforms/SLPVectorizer/AArch64/lcssa-phi-extract-scale.ll
+71-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+137-462 files

LLVM/project d9cbed5mlir/test/Dialect/LLVMIR attach-targets.mlir

[MLIR][GPU][NFC] Reformat GPU target attachment tests (#199339)

Reformat attach-targets.mlir so each GPU module has a labeled check
block, split target-attachment RUN lines, and keep comments tied to the
expected target-specific matches.
DeltaFile
+38-20mlir/test/Dialect/LLVMIR/attach-targets.mlir
+38-201 files

LLVM/project 3467e7fllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 lcssa-phi-inner-loop-scale.ll

[SLP] Fix extract-cost scale for LCSSA-phi external users in nested loops

getScaleToLoopIterations() used U->getParent() for all PHI-node external
users. For an LCSSA phi at an inner-loop exit still inside an outer loop,
this gave outer-loop scale instead of inner*outer scale. Because
ExtractCostCalculated deduplicates by scalar, only the first ExternalUser
determines the scale, making the cost order-dependent on use-list ordering
(and thus on .ll block ordering).

Reviewers: hiraditya, RKSimon, bababuck

Pull Request: https://github.com/llvm/llvm-project/pull/199954
DeltaFile
+24-18llvm/test/Transforms/SLPVectorizer/AArch64/lcssa-phi-inner-loop-scale.ll
+27-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+51-192 files

LLVM/project a59f995llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 recalc-copyable-node.ll

[SLP] Recompute copyable operand deps for duplicate copyable nodes

A bundle may duplicate a previously built node that has copyable elements
(same schedulable instructions, different copyable lane) while the parent
node also has copyable elements. An operand modeled as a copyable element
in the previous node is then used directly by the new node, which is not
registered in the tree yet. Recomputing that operand's direct
dependencies at this point misses the direct use, so the scheduler
decrements the operand more times than its dependency count and trips the
unscheduled-deps assertion.
Defer recomputation of such operand dependencies via
RecalcCopyableOperandDeps and redo it at the next bundle scheduling, when
the duplicate node is part of the tree. Also clear and recompute the
direct dependencies of bundles whose user is a gather node referenced
through EdgeIdx == UINT_MAX in scheduleBlock, so combined gather
sub-entries get correct dependencies against the full tree.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/200564
DeltaFile
+243-0llvm/test/Transforms/SLPVectorizer/AArch64/recalc-copyable-node.ll
+91-5llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+334-52 files

LLVM/project 80ad13autils/bazel/llvm-project-overlay/compiler-rt BUILD.bazel

[bazel] Fix compiler-rt:interception (#200561)

- Add `-DCOMPILER_RT_BUILD_PROFILE_ROCM=1`
- Prune `"lib/sanitizer_common/*.S"`, it means `*.inc.S`
- Add `-fvisibility=hidden`

Bazel doesn't add `-gline-tables-only` by default. Add flags to CMake
side to align the build to Bazel.

- `-DCOMPILER_RT_HAS_G_FLAG=OFF`
- `-DCOMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG=OFF`
DeltaFile
+6-2utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+6-21 files

LLVM/project a032f6cutils/bazel/llvm-project-overlay/compiler-rt BUILD.bazel

`-fomit-frame-pointer` and buildifier
DeltaFile
+2-1utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+2-11 files

LLVM/project 368746cllvm/include/llvm/IR Type.h DerivedTypes.h, llvm/lib/IR Use.cpp

move to Type.h?

Created using spr 1.3.8-wip
DeltaFile
+3-1llvm/include/llvm/IR/Type.h
+0-4llvm/include/llvm/IR/DerivedTypes.h
+0-1llvm/lib/IR/Use.cpp
+3-63 files

LLVM/project f15904eclang/test/OpenMP target_teams_codegen.cpp, llvm/include/llvm/Frontend/OpenMP OMPIRBuilder.h

[offload][OpenMP] Add strict flag for blocks and threads in kernel arguments (#199483)

Until now, strict behavior in the number of threads and blocks has been
applied only when the kernel is in bare mode. When this mode is enabled,
the values passed in UserNumBlocks and UserThreadLimit are not adjusted
and are the definitive values used to launch the kernel. This commit
detaches the strictness from the kernel mode.

This is going to be used by the kernel replay tool. Additionally, it
starts clearing the path for the upcoming OpenMP dims modifier, used to
configure multidimensional teams and leagues, which will include
strictness choices for teams and threads.

All the bare kernels must indicate strict behavior. Asserts are added to
check this condition.
DeltaFile
+153-0offload/test/offloading/ompx_bare_gridsize.c
+42-42clang/test/OpenMP/target_teams_codegen.cpp
+27-22offload/plugins-nextgen/common/src/PluginInterface.cpp
+41-0offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
+13-0offload/unittests/OffloadAPI/device_code/gridsize.cpp
+6-2llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+282-668 files not shown
+301-7314 files

LLVM/project 5f9a538utils/bazel/llvm-project-overlay/compiler-rt BUILD.bazel

[bazel] Fix compiler_rt:interception

- Add `-DCOMPILER_RT_BUILD_PROFILE_ROCM=1`
- Prune `"lib/sanitizer_common/*.S"`, it means `*.inc.S`
- Add `-fvisibility=hidden`

Bazel doesn't add `-gline-tables-only` by default. Add flags to CMake side to align the build to Bazel.

- `-DCOMPILER_RT_HAS_G_FLAG=OFF`
- `-DCOMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG=OFF`
DeltaFile
+5-2utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
+5-21 files

LLVM/project e3f80femlir/lib/Conversion/MathToSPIRV MathToSPIRV.cpp, mlir/test/Conversion/MathToSPIRV math-to-gl-spirv.mlir math-to-fpclassify-spirv.mlir

[mlir][SPIR-V] Convert math.clampf to spirv.GLFClamp and math.ctpop to spirv.BitCount (#200454)
DeltaFile
+15-0mlir/test/Conversion/MathToSPIRV/math-to-gl-spirv.mlir
+9-0mlir/test/Conversion/MathToSPIRV/math-to-fpclassify-spirv.mlir
+2-0mlir/lib/Conversion/MathToSPIRV/MathToSPIRV.cpp
+26-03 files

LLVM/project fdfb99flibcxx/include/__bit byteswap.h, libcxx/test/libcxx/transitive_includes cxx23.csv cxx26.csv

[libc++] std::byteswap support for _BitInt(N) (#196512)

Add a byte-reversal loop fallback for `std::byteswap` when `sizeof(T) >
16`,
so the function works for `_BitInt(N)` with `N > 128` and any future
wider
integer type. Without it, those calls hit `static_assert(sizeof(_Tp) ==
0)`
and fail to compile.

Reject `_BitInt(N)` where `N` is not a multiple of `CHAR_BIT`. The
existing
`__builtin_bswap{16,32,64,128}` paths swap the storage representation
including padding bits, and the resulting value's meaning is
unspecified.
A new `static_assert` catches that case and reports it. Size-1 types are
exempt from the check, since no bytes move there.

Part of the [_BitInt(N) libc++

    [6 lines not shown]
DeltaFile
+141-0libcxx/test/std/numerics/bit/byteswap.verify.cpp
+66-0libcxx/test/std/numerics/bit/byteswap.pass.cpp
+24-5libcxx/include/__bit/byteswap.h
+1-0libcxx/test/libcxx/transitive_includes/cxx23.csv
+1-0libcxx/test/libcxx/transitive_includes/cxx26.csv
+233-55 files

LLVM/project 02af47bclang/test/Driver freebsd.c

[Clang][test] Fix leading slash (#200549)

A reviewer in #200012 required checking for a leading (back-)slash to
the test despite none of the other tests doing so. Turns out, the slash
isn't there if the driver is unable to resolve the full path to the
linker. Remove the leading slash from the test.

Fixes reported buildbot failures:
 * clang-solaris11-sparcv9
 * clang-solaris11-amd64
DeltaFile
+4-4clang/test/Driver/freebsd.c
+4-41 files

LLVM/project 3c4bc6cllvm/lib/Transforms/InstCombine InstCombineSelect.cpp, llvm/test/Transforms/InstCombine select.ll

[InstCombine] Handle "trunc nuw to i1" as "icmp ne,0" in foldSelectValueEquivalence (#198131)

proof: https://alive2.llvm.org/ce/z/MGhWgE
DeltaFile
+65-1llvm/test/Transforms/InstCombine/select.ll
+11-0llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+76-12 files

LLVM/project c7614cdllvm/lib/Transforms/Scalar MergeICmps.cpp, llvm/test/Transforms/MergeICmps/X86 pair-int32-int32.ll

[MergeICmps] Don't merge comparisons whose width isn't a byte multiple (#200346)

MergeICmps looks for cases like

    struct S { char x; char y; }
    A.x == B.x && A.y == B.y

If `x` and `y` are stored adjacent to one another, we can convert the
above into a memcmp, which can then be converted into a single 16-bit
compare.

This pass currently does the wrong thing if the struct members' sizes
are not multiples of 8 bits. To fix this, we simply bail if the elements
in question are not multiples of one byte.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
DeltaFile
+55-0llvm/test/Transforms/MergeICmps/X86/pair-int32-int32.ll
+9-0llvm/lib/Transforms/Scalar/MergeICmps.cpp
+64-02 files

LLVM/project c22f566llvm/lib/Transforms/Scalar LICM.cpp, llvm/test/Transforms/LICM hoist-add-sub.ll

[LICM] Drop poison-generating flags when reassociating an icmp (#200344)

`hoistAdd`/`hoistSub` turn `LV + C1 <pred> C2` into `LV <pred> C2 - C1`,
changing the icmp's LHS. A `samesign` flag asserted about the old
operands need not hold for the new LHS, so keeping it can turn a defined
comparison into poison (e.g. for `%iv = -3`, `samesign slt(2, 100)` is
true but the reassociated `samesign slt(-3, 95)` has
opposite-sign operands → poison). Drop the icmp's poison-generating
flags after the rewrite, as `hoistMulAddAssociation` already does.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
DeltaFile
+39-6llvm/test/Transforms/LICM/hoist-add-sub.ll
+6-0llvm/lib/Transforms/Scalar/LICM.cpp
+45-62 files

LLVM/project 093c76allvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp, llvm/test/CodeGen/X86 atomic-mmo-align.ll

[SelectionDAG] Preserve IR alignment on atomicrmw/cmpxchg MMOs (#200332)

Previously SelectionDAG used the natural alignment of the value type,
even if the instruction specified a different alignment.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
DeltaFile
+22-0llvm/test/CodeGen/X86/atomic-mmo-align.ll
+5-5llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+27-52 files

LLVM/project 9e3c184llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-shuffle-combining-avx512vbmi2.ll

Revert "[X86] matchBinaryPermuteShuffle - match to X86ISD::SHLD funnel shift patterns" (#200546)

Reverts llvm/llvm-project#200136 while I investigate a miscompilation report
DeltaFile
+0-46llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11llvm/test/CodeGen/X86/vector-shuffle-combining-avx512vbmi2.ll
+14-572 files

LLVM/project 9d0ce81flang/lib/Semantics check-omp-loop.cpp, flang/test/Semantics/OpenMP linear-clause-array-section.f90

[Flang][OpenMP] Reject array sections and subobjects in LINEAR clause (#197430)

Array sections like a(:,1,1) and array elements like a(1) in a LINEAR
clause cause a crash during MLIR-to-LLVM IR translation because the
semantic checker doesn't catch them.

This adds a call to CheckVarIsNotPartOfAnotherVar for the LINEAR clause,
which is the same check used by PRIVATE and FIRSTPRIVATE to reject
subobject designators.

Fixes :
[https://github.com/llvm/llvm-project/issues/196068](https://github.com/llvm/llvm-project/issues/196068)

Co-authored-by: Chandra Ghale <ghale at pe34genoa.hpc.amslabs.hpecorp.net>
DeltaFile
+64-0flang/test/Semantics/OpenMP/linear-clause-array-section.f90
+1-0flang/lib/Semantics/check-omp-loop.cpp
+65-02 files

LLVM/project 666a8cfflang/include/flang/Parser parse-tree.h, flang/lib/Parser program-parsers.cpp

[Flang][Parser] Handle compiler directives inside INTERFACE blocks (#198516)

Unrecognized !DIR$ directives between interface specifications currently
cause cascading parse errors because the grammar for
InterfaceSpecification has no path to consume them. This patch adds
CompilerDirective as a valid alternative — matching how
InternalSubprogram and ModuleSubprogram already handle this — so that
unrecognized directives produce the expected warning instead of a fatal
parse failure.

Fixes :
[https://github.com/llvm/llvm-project/issues/198289](https://github.com/llvm/llvm-project/issues/198289)

---------

Co-authored-by: Chandra Ghale <ghale at pe34genoa.hpc.amslabs.hpecorp.net>
DeltaFile
+60-0flang/test/Parser/compiler-directive-in-interface.f90
+5-2flang/include/flang/Parser/parse-tree.h
+4-2flang/lib/Parser/program-parsers.cpp
+69-43 files

LLVM/project 17fdb39clang/test/Driver freebsd.c

Revert "[Clang][test] Fix space in ld path (#200012)"

This reverts commit 8918dd8b4dc646fa9707bbfedd4efe5116abe971.
DeltaFile
+4-4clang/test/Driver/freebsd.c
+4-41 files

LLVM/project ca57bb8llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-shuffle-combining-avx512vbmi2.ll

Revert "[X86] matchBinaryPermuteShuffle - match to X86ISD::SHLD funnel shift …"

This reverts commit 86a74788dcc851d501e33c70a88f14dc47293b9f.
DeltaFile
+0-46llvm/lib/Target/X86/X86ISelLowering.cpp
+14-11llvm/test/CodeGen/X86/vector-shuffle-combining-avx512vbmi2.ll
+14-572 files

LLVM/project 799b866llvm/lib/CodeGen/SelectionDAG LegalizeVectorTypes.cpp

[SelectionDAG] Remove redundant asserts in WidenVecRes_ATOMIC_LOAD (#200159)

These asserts duplicate guarantees already provided elsewhere:
- `isVector()` checks are redundant because `findMemType()` calls
  `WidenVT.getVectorElementType()` and `WidenVT.isScalableVector()`
  internally, and `WidenVecRes_ATOMIC_LOAD` is only reached from the
  `ATOMIC_LOAD` case in `WidenVectorResult`, which is the vector path.
- The element-type and scalability consistency between `LdVT` and
`WidenVT` is a property of `GetWidenedVector` / `getTypeToTransformTo`.

Follow-up to feedback on #197618.
DeltaFile
+0-5llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+0-51 files