LLVM/project 69547b1 — flang/lib/Semantics canonicalize-omp.cpp, flang/test/Parser/OpenMP metadirective-dirspec.f90

[flang][OpenMP] Make sure that exec METADIRECTIVE is in execution part

A METADIRECTIVE can be in either the specification part or the execution
part, depending on whether the variant directives contained in it are
declarative or executable. The OmpMetadirectiveDirective AST node can
hold any combination of variants, that is it can represent both kinds.
When the parser builds the specification part and attempts to create
an OmpMetadirectiveDirective, once it gets one it puts it in the
specification part regardless of the contents.

When an executable METADIRECTIVE is the first statement of the execution
part, it will end up in the specification part. This is an identical
situation as that for utility directives.

Recognize executable METADIRECTIVEs at the end of the specification
part and move them over to the beginning of the execution part.
DeltaFile
+55-13flang/lib/Semantics/canonicalize-omp.cpp
+4-2flang/test/Parser/OpenMP/metadirective-dirspec.f90
+59-152 files

LLVM/project bcc6ac1 — clang/lib/AST StmtProfile.cpp, clang/test/OpenMP condition_identity.cpp condition_identity.c

Create an isolated implementation branch from refreshed main and record its
base. Preserve existing local files. Keep B's diff separate from A's TARGET
normalization and construct-subset changes, and from C's scoring changes.

**Implementation approach.** Give the original condition an explicit,
frontend-produced structural identity. Preserve it across candidate copies
and transformations. Compare source selector identity separately from the
effective traits used for applicability and scoring.

Prefer an owned structural key with exact equality, or an interned equivalent
whose owner demonstrably outlives every comparison. LLVM should not depend
on Clang or Flang AST types. A hash can accelerate lookup, but hash equality
alone must never prove expression equality.

The largest design work is producing correct keys. Neither a raw source
string, a folded expression, nor the current generic Clang profile satisfies
the required contract. Complete the capture and equivalence checkpoint below
before treating a proposed key format as ready for integration.


    [266 lines not shown]
DeltaFile
+211-0flang/test/Lower/OpenMP/metadirective-condition-identity.f90
+155-2flang/lib/Semantics/openmp-utils.cpp
+136-0flang/test/Lower/OpenMP/declare-variant-condition-identity.f90
+126-0clang/test/OpenMP/condition_identity.c
+91-3clang/lib/AST/StmtProfile.cpp
+93-0clang/test/OpenMP/condition_identity.cpp
+812-58 files not shown
+983-914 files

LLVM/project 1ae7172 — llvm/test/tools/gold/X86 vectorize.ll, llvm/tools/gold gold-plugin.cpp

LLVMgold: Parse -plugin-opt options into LibraryOptionsContext (#233144)

Since #233044, the LLVMContexts that LTO creates read the defaults
instead, so passes ignore options like -vectorize-loops.

Parse them into a cl::LibraryOptionsContext and set it as
lto::Config::LibraryOptions and the PipelineTuningOptions' context, as
lld does.
DeltaFile
+13-6llvm/tools/gold/gold-plugin.cpp
+4-0llvm/test/tools/gold/X86/vectorize.ll
+17-62 files

LLVM/project 3d7d2e9 — llvm/lib/Transforms/Vectorize VPlanTransforms.h LoopVectorize.cpp

[VPlan] Only hoist from blocks guaranteed to execute in licm (NFC). (#232512)

When hoisting, licm assumes that all top-level blocks of the vector loop
region execute on every iteration, which holds as long as the region is
linearized. Check it explicitly, by only hoisting from blocks that
dominate the region's exiting block.

Currently NFC, but preparation to run LICM before linearization and
support partially linearized CFG.

PR: https://github.com/llvm/llvm-project/pull/232512
DeltaFile
+12-12llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-1llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+1-1llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+14-143 files

LLVM/project 25fc6f0 — llvm/test/Transforms/LoopVectorize/AArch64 gather-do-not-vectorize-addressing.ll sve2-histcnt.ll

[LV] Add test for miscompiles with histograms and scalarization. (#233135)

Add 2 additional tests for miscompile with stores to invariant addresses
and histograms and incorrectly scalarizing loads feeding a first-order
recurrence.

Also modernize check lines while touching the tests.
DeltaFile
+520-324llvm/test/Transforms/LoopVectorize/AArch64/sve2-histcnt.ll
+335-71llvm/test/Transforms/LoopVectorize/AArch64/gather-do-not-vectorize-addressing.ll
+855-3952 files

LLVM/project fab00c4 — llvm/lib/Transforms/Utils LoopUtils.cpp, llvm/test/Transforms/LoopVectorize runtime-checks-hoist.ll

[LV] Don't emit duplicate negative stride runtime checks

This speeds up x264 by 2.15% on RISC-V by avoiding a duplicate hoisted runtime check.

When hoisting runtime checks we need to check that any strides are non negative. But for a loop like

```c
for (int i = 0; i < m; i++)
  for (int j = 0; j < n; j++)
    dst[(i * stride1) + j] = src1[(i * stride2) + j] + src2[(i * stride2) + j];
```

We have the pairs [dst, src1] and [dst, src2]. Both pairs end up checking that stride1 and stride2 are non-negative in IsConflict, and because there's other values between the two checks in the chain of ors InstCombine can't deduplicate it. This PR deduplicates the stride checks.

I'm aware some of this memory check stuff is being moved into VPlan but I'm not sure what the plan is with hoisted runtime checks, so it seemed better to just fix it here first.

This helps all targets but the motivating case is this loop in x264:

```c

    [82 lines not shown]
DeltaFile
+10-10llvm/test/Transforms/LoopVectorize/AArch64/low_trip_memcheck_cost.ll
+1-5llvm/test/Transforms/LoopVectorize/runtime-checks-hoist.ll
+3-2llvm/lib/Transforms/Utils/LoopUtils.cpp
+14-173 files

LLVM/project 4bd435d — mlir/include/mlir/ExecutionEngine ExecutionEngine.h, mlir/lib/ExecutionEngine ExecutionEngine.cpp JitRunner.cpp

[ExecutionEngine] Set mlir-runner's library options in the LLVMContext (#233131)

Since #233044, the LLVMContext that ExecutionEngine creates reads the
defaults instead, so LowerMatrixIntrinsics ignores
-matrix-default-layout=row-major and
Integration/Dialect/Vector/CPU/*-row.mlir fail.

Parse the options into a cl::LibraryOptionsContext and add
ExecutionEngineOptions::libraryOptions.
DeltaFile
+10-1mlir/lib/ExecutionEngine/JitRunner.cpp
+5-0mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+3-0mlir/include/mlir/ExecutionEngine/ExecutionEngine.h
+18-13 files

LLVM/project 145a867 — llvm/lib/Transforms/Instrumentation SanitizerBinaryMetadata.cpp, llvm/test/Instrumentation/SanitizerBinaryMetadata argext.ll

[SanMD] Add extension on version argument. (#232890)

Co-authored with IBM Bob.
DeltaFile
+17-14llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp
+17-0llvm/test/Instrumentation/SanitizerBinaryMetadata/argext.ll
+34-142 files

LLVM/project 9c0e233 — llvm/include/llvm/IR Attributes.h, llvm/lib/Transforms/Instrumentation NumericalStabilitySanitizer.cpp

[NSan] Add extensions as needed on function declarations. (#232600)

Co-authored with IBM Bob.
DeltaFile
+29-8llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp
+11-0llvm/test/Instrumentation/NumericalStabilitySanitizer/argext.ll
+9-0llvm/include/llvm/IR/Attributes.h
+49-83 files

LLVM/project 2fd4e5c — llvm/include/llvm/Analysis ScalarEvolution.h, llvm/lib/Analysis ScalarEvolution.cpp

[SCEV] Don't re-check already predicates of a SCEVUnionPredicate (NFC) (#232966)

SCEVUnionPredicate's construct adds predicates one-by-one to the union
and tries to remove duplicated predicates, which can be quite expensive
(checking implications between all pairs of predicates).

Using assignment/copy ctor instead when copying avoids the unnecessary
checks and$ improves compile-time in workloads with many predicates:

tramp3d-v4 stage1/2 O3 around -0.20%


https://llvm-compile-time-tracker.com/compare.php?from=60d847e7e7c1cbd6e185ce7f7802dad2f9504523&to=38b7c1fb51a8fe804f585c11233178f815dcda6d&stat=instructions:u

Aided by Opus 5.5

PR: https://github.com/llvm/llvm-project/pull/232966
DeltaFile
+2-5llvm/lib/Analysis/ScalarEvolution.cpp
+1-1llvm/include/llvm/Analysis/ScalarEvolution.h
+3-62 files

LLVM/project 50395a3 — llvm/test/Transforms/LoopVectorize runtime-checks-hoist.ll

[LV] Add test duplicate negative stride checks in hoisted runtime checks. NFC (#233130)

In this test we have [dst, src1], [dst, src2] as pointer pairs, and for
hoisted
runtime checks both pairs need to check that stride1 and stride2 are
non-negative. But we end up emitting duplicate `icmp slt i64
stride{1,2}, 0`
checks across the two pairs when we only need to check them once.

Extracted from pixel_avg in x264.
DeltaFile
+166-0llvm/test/Transforms/LoopVectorize/runtime-checks-hoist.ll
+166-01 files

LLVM/project eb5c3a2 — llvm/include/llvm/Option LibraryOptions.h, llvm/include/llvm/Support CommandLine.h LibraryOptionsContext.h

[Support] Remove the T::Global fallback in LibraryOptionsContext::get<T>() (#233044)

A context's values for T start as a copy of T::Global, which
cl::ParseCommandLineOptions sets, and get<T>() returns T::Global for a
context without values for T. Use a new constant T::Default instead, so
a tool must parse library options with
`cl::parseCommandLineOptions(LibraryOptionsContext &, ...)`.

LLM-aided
DeltaFile
+4-9llvm/include/llvm/Support/LibraryOptionsContext.h
+6-3llvm/include/llvm/Support/CommandLine.h
+5-2llvm/include/llvm/Option/LibraryOptions.h
+4-1llvm/utils/TableGen/Basic/OptionParserEmitter.cpp
+2-2llvm/lib/Support/CommandLine.cpp
+2-1llvm/unittests/Support/CommandLineTest.cpp
+23-182 files not shown
+25-228 files

LLVM/project fa0b01a — mlir/test/Dialect/SCF canonicalize.mlir

[mlir][scf] Test forall promotion with multiple inserts (#232920)

Cover #231826 by checking that disjoint insertions into one shared
output are chained into a single result.

Assisted-by: Codex / GPT-6
DeltaFile
+18-0mlir/test/Dialect/SCF/canonicalize.mlir
+18-01 files

LLVM/project 29d4cfe — llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/X86 pr232598.ll

[DAG] SimplifyDemandedVectorElts - only assume KnownZero if the shift/rotate amount is not undef/poison (#233115)

Fixes #232598
DeltaFile
+17-29llvm/test/CodeGen/X86/pr232598.ll
+1-1llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+18-302 files

LLVM/project fcb763b — clang/test/CIR/CodeGen sve-vector-arith-ops.c, clang/test/OpenMP single_codegen.cpp threadprivate_codegen.cpp

Rebase, address comments

Created using spr 1.3.7
DeltaFile
+1,275-1,275clang/test/OpenMP/threadprivate_codegen.cpp
+626-626clang/test/OpenMP/single_codegen.cpp
+983-0clang/test/CIR/CodeGen/sve-vector-arith-ops.c
+0-681lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+681-0lldb/source/Plugins/Process/Utility/RegisterInfo_arm64.cpp
+272-264flang/lib/Semantics/canonicalize-omp.cpp
+3,837-2,846485 files not shown
+15,652-7,114491 files

LLVM/project aa86865 — clang/lib/CodeGen CGExprCXX.cpp, clang/test/CodeGenCXX new-array-cookie-overflow.cpp

[clang][CodeGen] Fix assertion failure for new T[SIZE_MAX] with array cookie (#232570)

Fixes #232250.

`EmitCXXNewExpr` asserts that `allocSize == allocSizeWithoutCookie` if
and only if no array cookie is needed. The "only if" direction does not
always hold.

`EmitCXXNewAllocSize` replaces the allocation size with an all-ones
value when the size computation overflows, so that `operator new` fails.
If the count times the element size is already all-ones and adding the
cookie then overflows, both values are the same uniqued constant even
though a cookie is present. For example, on i386:

  struct S { ~S(); };
  void f() { new S[0xFFFFFFFFu]; }

Here `sizeof(S) == 1`, the cookie is 4 bytes, and `0xFFFFFFFF + 4`
overflows, so the assertion fired. This can't happen on 64-bit targets

    [6 lines not shown]
DeltaFile
+15-0clang/test/CodeGenCXX/new-array-cookie-overflow.cpp
+6-2clang/lib/CodeGen/CGExprCXX.cpp
+21-22 files

LLVM/project 35f840b — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPUtils.cpp SLPCompatibilityAnalysis.h

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+74-28llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.cpp
+57-13llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+21-43llvm/test/Transforms/SLPVectorizer/X86/interchangeable-cmp-predicates.ll
+20-11llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h
+12-8llvm/test/Transforms/SLPVectorizer/revec.ll
+2-1llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPUtils.cpp
+186-1046 files

LLVM/project 27e262a — llvm/test/Transforms/SLPVectorizer revec.ll, llvm/test/Transforms/SLPVectorizer/X86 interchangeable-cmp-predicates.ll

[SLP][NFC]Add a test for trunc i1 to icmp, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/233122
DeltaFile
+254-0llvm/test/Transforms/SLPVectorizer/X86/interchangeable-cmp-predicates.ll
+69-0llvm/test/Transforms/SLPVectorizer/revec.ll
+323-02 files

LLVM/project c4fe77e — llvm/lib/DWARFLinker/Classic DWARFLinker.cpp, llvm/lib/DWARFLinker/Parallel DWARFLinkerCompileUnit.cpp DIEAttributeCloner.cpp

[DWARFLinker] Emit DW_AT_addr_base for units that had none (#219357)

Fix DWARFv5 units that reach the linker without DW_AT_addr_base, as GCC
emits them at -O2. Both linkers rewrite range and location lists into
base_addressx entries, which resolve through DW_AT_addr_base, but they
only ever patch an attribute copied from the input. With nothing to
patch, the classic linker hits the llvm_unreachable in patchAddrBase(),
and the parallel linker writes indices with no base, so the unit's
ranges resolve from address 0.

Add DW_AT_addr_base to every DWARFv5 unit root that lacks one, whatever
its tag, and emit the unit's .debug_addr contribution even when no
address was pooled, so the attribute always points at a table. Update
mode does not rewrite ranges, so nothing is added there.

The tests link a compile unit root and a partial unit root with both
linkers and check the attribute, the address table, the range list and
--verify. The compile unit test also checks that update mode adds no
attribute, and a third test links a unit that pools no address.

    [3 lines not shown]
DeltaFile
+116-0llvm/test/tools/llvm-dwarfutil/ELF/X86/dwarf5-no-addr-base.test
+105-0llvm/test/tools/llvm-dwarfutil/ELF/X86/dwarf5-no-addr-base-partial-unit.test
+74-0llvm/test/tools/llvm-dwarfutil/ELF/X86/dwarf5-no-addr-base-empty.test
+20-0llvm/lib/DWARFLinker/Parallel/DIEAttributeCloner.cpp
+14-2llvm/lib/DWARFLinker/Classic/DWARFLinker.cpp
+2-3llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp
+331-51 files not shown
+334-57 files

LLVM/project e90fde1 — llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/AArch64 fpclamptosat.ll

[DAGCombiner] Fold umin(fp_to_uint(x), 0) to 0 (#232231)

`PerformUMinFpToSatCombine` turns `umin(fp_to_uint(x), (2^n)-1)` into
`fp_to_uint_sat`.

When the clamp width is 0 (2^0-1), `n` is also 0, and `getIntegerVT(0)`
then asserts in `IntegerType::get`, which requires a width of at least
1.

Since an unsigned value is never below 0, the `umin`'s result will
always be 0 as well.
DeltaFile
+16-1llvm/test/CodeGen/ARM/fpclamptosat.ll
+17-0llvm/test/CodeGen/RISCV/fpclamptosat.ll
+13-0llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
+12-0llvm/test/CodeGen/X86/fpclamptosat.ll
+12-0llvm/test/CodeGen/AArch64/fpclamptosat.ll
+5-0llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+75-16 files

LLVM/project edd70e7 — cross-project-tests/intrinsic-header-tests riscv_packed_simd.c

fixup! update cross-project test
DeltaFile
+6-6cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
+6-61 files

LLVM/project 0b50885 — llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV rvp-simd-32.ll

[RISCV][P-ext] Use concat_vectors with 0 in widenPackedVectorWithZeros.

This will be legalized and combined to a vector_shuffle. That
shuffle can then be matched to a pack with x0 after #232892.

This changes the zext.w to a pack, but that's not obviously worse.
If we need to canonicalize we can add a DAG combine later.
DeltaFile
+8-8llvm/test/CodeGen/RISCV/rvp-simd-32.ll
+4-5llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+12-132 files

LLVM/project 557fb42 — llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV rvp-insert-subvector.ll

[RISCV][P-ext] Remove custom lowering of insert_subvector for v2i16/v4i8 on RV64.

This was for handling inserting into a zero vector. After #232892
we let the insert_subvector legalize to a shuffle_vector which we
can then lower as pack.

This changes the codegen from zext.w to pack, but that's not
necessarily worse. If it turns out to be a problem we can
canonicalize pack with zero with a DAGCombine or isel patterns in
the future.
DeltaFile
+3-11llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+2-2llvm/test/CodeGen/RISCV/rvp-insert-subvector.ll
+5-132 files

LLVM/project 26e8f25 — llvm/lib/Target/RISCV RISCVISelLowering.cpp

[RISCV][P-ext] Create zero vector rather than bitcasting from i32 0 in lowerINSERT_SUBVECTOR. (#232852)

Teach LowerBUILD_VECTOR to create SPLAT_VECTOR when all operands are the
same to prevent regression.
DeltaFile
+5-1llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+5-11 files

LLVM/project 05d5e1f — llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV rvp-simd-32.ll rvp-simd-64.ll

[RISCV][P-ext] Call tryWidenMaskForShuffle at the end of P extension shuffle lowering. (#232892)

If the shuffle mask has contiguous elements we can try shuffling them
using a large element type.
DeltaFile
+24-48llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+0-8llvm/test/CodeGen/RISCV/rvp-simd-32.ll
+4-1llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+28-573 files

LLVM/project dc057e3 — flang/unittests/Frontend CompilerInstanceTest.cpp FrontendActionTest.cpp, flang/unittests/Semantics OpenMPUtils.cpp

[flang,unittest] Initialize targets before creating a CompilerInstance. NFC (#233117)

Initialize targets first to register library options before creating a
CompilerInstance.
DeltaFile
+9-4flang/unittests/Semantics/OpenMPUtils.cpp
+9-4flang/unittests/Frontend/FrontendActionTest.cpp
+3-3flang/unittests/Frontend/CompilerInstanceTest.cpp
+21-113 files

LLVM/project ce640be — flang/lib/Semantics canonicalize-omp.cpp

[flang][OpenMP] Simplify some code with parser::Unwrap, NFC (#233113)
DeltaFile
+8-30flang/lib/Semantics/canonicalize-omp.cpp
+8-301 files

LLVM/project 50d1557 — llvm/test/CodeGen/X86 pr232598.ll

[X86] Add test case for #232598 (#233109)
DeltaFile
+57-0llvm/test/CodeGen/X86/pr232598.ll
+57-01 files

LLVM/project 545ee64 — libc/src/__support frac64.h big_int.h, libc/src/__support/math CMakeLists.txt exp2f_integer_utils.h

[libc][math] Optimize integer-only expf and factor out shared utilities.

- Optimize `expf_integer_eval` for both code size and performance.
- Factor out the shared range reduction and `2^u` fixed point evaluation to
be used by `exp2f` and `exp10f` integer-only versions.

Assisted-by: Gemini for analysis and refactoring.
DeltaFile
+60-236libc/src/__support/math/expf_integer_eval.h
+182-0libc/src/__support/math/exp2f_integer_utils.h
+48-10libc/src/__support/big_int.h
+36-0libc/test/shared/shared_math_test.cpp
+16-12libc/src/__support/frac64.h
+19-2libc/src/__support/math/CMakeLists.txt
+361-2608 files not shown
+389-26414 files

LLVM/project c5b339f — clang/test/CIR/CodeGen sve-vector-arith-ops.c, clang/test/OpenMP threadprivate_codegen.cpp task_codegen.cpp

Merge branch 'main' into users/tmahatej/amdgpu/dag-combine-sat-combine
DeltaFile
+7,716-7,532llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+2,795-3,867llvm/test/CodeGen/AMDGPU/clmul.ll
+1,897-1,897clang/test/OpenMP/task_codegen.cpp
+1,275-1,275clang/test/OpenMP/threadprivate_codegen.cpp
+2,444-0clang/test/CIR/CodeGen/sve-vector-arith-ops.c
+725-1,475llvm/test/CodeGen/NVPTX/i8x4-instructions.ll
+16,852-16,0462,701 files not shown
+125,545-79,2152,707 files