LLVM/project 4a128eb — llvm/lib/Target/SPIRV SPIRVInstructionSelector.cpp, llvm/test/CodeGen/SPIRV atomicrmw.ll

[SPIR-V] Set register class on entry block i32 constants (#245610)

Without it the vreg gets the generic ID class and later i32 constant
lookups reuse it as an iID operand

This verifier failure caused the revert of switching to NewPM in #239489
DeltaFile
+12-0llvm/test/CodeGen/SPIRV/atomicrmw.ll
+1-0llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+13-02 files

LLVM/project 8277762 — llvm/lib/Target/LoongArch LoongArchLASXInstrInfo.td LoongArchLSXInstrInfo.td, llvm/test/CodeGen/LoongArch/lasx xvmskcond-vec.ll

[LoongArch] Lower insertion of masks into zero vectors to [x]vmsk*

[x]vmsk* already zero-extends the mask of each 128-bit lane to the lane, so
there is no need to move the mask to GPR and back:

```
  xvmskltz.b      $xr0, $xr0
  xvpickve2gr.wu  $a0, $xr0, 0
  xvpickve2gr.wu  $a1, $xr0, 4
  bstrins.d       $a0, $a1, 31, 16
  bstrpick.d      $a1, $a0, 15, 0
  srli.d          $a0, $a0, 16
  xvrepli.b       $xr0, 0
  xvinsgr2vr.d    $xr0, $a1, 0
  xvinsgr2vr.d    $xr0, $a0, 2
```

becomes:


    [5 lines not shown]
DeltaFile
+52-327llvm/test/CodeGen/LoongArch/lasx/xvmskcond-vec.ll
+38-151llvm/test/CodeGen/LoongArch/lsx/vmskcond-vec.ll
+75-0llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+12-0llvm/lib/Target/LoongArch/LoongArchLSXInstrInfo.td
+6-0llvm/lib/Target/LoongArch/LoongArchLASXInstrInfo.td
+183-4785 files

LLVM/project b529632 — llvm/lib/Target/LoongArch LoongArchISelLowering.cpp, llvm/test/CodeGen/LoongArch/lasx xvmskcond-vec.ll xvmskcond-not.ll

[LoongArch] Compute known bits for [X]VMSK* nodes

The bits above the mask are known to be zero, so redundant zero-extensions
can be removed.

This turns the inversion of a mask into a XOR with a constant, which doesn't
fit in xori if the mask has more than 12 bits. Invert the mask in the vector
instead, or use NOR and BSTRPICK if that isn't possible. Likewise, compare
the inverted mask with zero instead of the mask with all ones.

```
  vmskltz.b      $vr0, $vr0
  vpickve2gr.hu  $a0, $vr0, 0
  nor            $a0, $a0, $zero
  bstrpick.d     $a0, $a0, 15, 0
```

becomes:


    [9 lines not shown]
DeltaFile
+232-1llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+26-65llvm/test/CodeGen/LoongArch/lsx/vmskcond-not.ll
+10-24llvm/test/CodeGen/LoongArch/lasx/xvmskcond-not.ll
+4-5llvm/test/CodeGen/LoongArch/lasx/xvmskcond-vec.ll
+0-8llvm/test/CodeGen/LoongArch/lsx/vmskcond-vec.ll
+2-4llvm/test/CodeGen/LoongArch/lsx/bstrpick.ll
+274-1076 files

LLVM/project f94fbb5 — clang-tools-extra/clang-tidy/readability EnumInitialValueCheck.cpp, clang-tools-extra/test/clang-tidy/checkers/readability enum-initial-value-allow-refs.c enum-initial-value-allow-refs.cpp

[clang-tidy] readability-enum-initial-value: fix self-reference detection (#228401)

[clang-tidy] readability-enum-initial-value: fix self-reference
detection

Fix `AllowReferencedInitialValues` failing to recognize references to
another enumerator in unscoped enums when the reference is implicitly
converted to the enum's underlying type.

Add a regression test for this case.

---
LLVM already supports enumerators that explicitly refer to another
enumerator through AllowReferencedInitialValues.
For example, the existing implementation supports:

  E_a,
  E_b,
  E_last = E_b,

    [35 lines not shown]
DeltaFile
+20-1clang-tools-extra/test/clang-tidy/checkers/readability/enum-initial-value-allow-refs.cpp
+7-4clang-tools-extra/clang-tidy/readability/EnumInitialValueCheck.cpp
+2-1clang-tools-extra/test/clang-tidy/checkers/readability/enum-initial-value-allow-refs.c
+29-63 files

LLVM/project 4732b41 — llvm/lib/Target/RISCV RISCVInstrInfoA.td, llvm/test/CodeGen/RISCV atomic-signext.ll atomic-rmw.ll

[RISCV] Predicate AMO patterns on Zaamo instead of A (#246235)

The AMO patterns were guarded by `+a` and the LR/SC pseudo patterns by
the absence of `+zaamo`. With `+zaamo,+zalrsc` but no `+a`, neither
matches
and `atomicrmw` fails with "Cannot select".
    
Guard them with `HasStdExtZaamo`, the predicate the `amo*` instructions
are defined under. The new `-a,+zaamo,+zalrsc` test runs share the `+a`
check prefixes.

Fixes #246093.

Assisted-by: TRAE CLI (GLM-5.4)
DeltaFile
+2-2llvm/lib/Target/RISCV/RISCVInstrInfoA.td
+4-0llvm/test/CodeGen/RISCV/atomic-signext.ll
+4-0llvm/test/CodeGen/RISCV/atomic-rmw.ll
+4-0llvm/test/CodeGen/RISCV/atomic-rmw-sub.ll
+4-0llvm/test/CodeGen/RISCV/atomic-load-store.ll
+4-0llvm/test/CodeGen/RISCV/atomic-cmpxchg.ll
+22-26 files

LLVM/project f07e061 — llvm/test/Transforms/LoopVectorize/X86 epilogue-vectorization-interleave-gap-divergence.ll

[LV] Add test command for divergent main/epilogue interleaved group widening decisions. nfc (#246022)

The new test command uses a scalar main vector loop (VF=1, UF=4) and an
epilogue vector loop with VF=2. The interleave group analysis finds a
load group with a gap that requires a scalar epilogue. Neither plan
widens it as an interleaved access (for VF=2 the cost model prefers
scalarization), but the epilogue vector loop is still forced to require
a scalar epilogue while the main loop does not.
This discrepancy in scalar epilogue requirements between the main and
epilogue loops causes an incorrect min-iteration check.

See #245054.
DeltaFile
+649-525llvm/test/Transforms/LoopVectorize/X86/epilogue-vectorization-interleave-gap-divergence.ll
+649-5251 files

LLVM/project fb0e1a2 — clang/lib/CIR/Dialect/Transforms CIRForwardReturnStore.cpp, clang/test/CIR/CodeGen object-size-flex-array.c ternary-throw.cpp

[CIR] Return the dominating store to the return slot directly

Classic codegen returns the stored value directly when the only store to
the return value slot dominates the return (findDominatingStoreToReturnValue
in CGCall.cpp), and then usually erases the slot. ClangIR always lowered the
slot to alloca, store, load and ret, so the LLVM IR of nearly every
scalar-returning function differed from classic codegen at -O0.

Add cir-forward-return-store to the pre-lowering pipeline, after FlattenCFG,
so -emit-cir output is unchanged and the ABI-lowered return is already in
place. It follows the classic rules: one cir.return of a value (classic has
one return block); a single store whose block is reached by following single
predecessors up from the return, or, if the slot has other uses, a store
right before the load; no volatile or atomic accesses; no record, array or
complex slots. The return takes the store's location and the slot is erased
once unused.

Assisted-by: Claude Code (claude-opus-5-5).
DeltaFile
+44-187clang/test/CIR/CodeGen/unary.cpp
+139-0clang/test/CIR/Transforms/forward-return-store.cir
+138-0clang/lib/CIR/Dialect/Transforms/CIRForwardReturnStore.cpp
+14-54clang/test/CIR/CodeGenBuiltins/X86/keylocker.c
+17-46clang/test/CIR/CodeGen/ternary-throw.cpp
+27-27clang/test/CIR/CodeGen/object-size-flex-array.c
+379-31493 files not shown
+639-1,06599 files

LLVM/project 4070dd3 — llvm/tools/llvm-size llvm-size.cpp

[llvm-size] Refactor output formatting into SizePrinter classes (NFC)

Introduce a class-based SizePrinter abstraction (SummarySizePrinter,
BerkeleySizePrinter, SysVSizePrinter, DarwinSizePrinter) to encapsulate
format-specific state and output logic instead of branching on
OutputFormat across printObject and printObjectSectionSizes.

Move per-run state (HeaderPrinted and totals) from file-scope globals
into printer instances, preparing llvm-size for cleanly adding
additional output formats such as GNU (-G / --format=gnu) and JSON.

Assisted-by: Gemini
DeltaFile
+327-254llvm/tools/llvm-size/llvm-size.cpp
+327-2541 files

LLVM/project 90e7c00 — llvm/tools/llvm-size llvm-size.cpp

[llvm-size] Extract size calculation and radix formatting helpers (NFC) (#243384)

Extract getBerkeleySectionSizes (SummarySizes) and getMachOSegmentSizes
(MachOSegmentSizes), deduplicate 32-bit and 64-bit Mach-O segment loops,
and replace dynamic format-string buffers (getRadixFmt) with
printRadixNumber, printBerkeleyRow, and left_justify/right_justify.

Assisted-by: Gemini
DeltaFile
+232-263llvm/tools/llvm-size/llvm-size.cpp
+232-2631 files

LLVM/project bc19d6d — clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenCXX.cpp

[CIR] Mark LoweringPrepare init functions strictfp

Classic codegen's StartFunction makes a function that has no
FunctionDecl `strictfp` when the TU-wide default FP environment is
constrained: FP exceptions are not ignored or the rounding mode is
dynamic. Of those functions ClangIR creates `_GLOBAL__sub_I_*`,
`_GLOBAL__I_*`, the C++20 module initializer, `__cxx_global_var_init*`,
`__cxx_global_array_dtor*` and `__tls_init`. It marked only
`__cxx_global_var_init*`, through a `strictfp` attribute on `cir.global`,
so the other functions and the calls in them were not `strictfp`.
Classic also marks the `__dtor_*` stubs, `_GLOBAL__D_a` and
`__GLOBAL_cleanup_*`, which ClangIR does not emit.

LoweringPrepare creates these functions after CIRGen, so it reads the
TU-wide default from `#cir.lowering_options`. `no_trapping_math` already
records whether FP exceptions are ignored, and the new `rounding_math`
field mirrors `LangOptions::RoundingMath`. It is omitted when false, so
the module attribute prints as before without `-frounding-math`.
`buildRuntimeFunction` adds `strictfp` together with the other TU-wide

    [8 lines not shown]
DeltaFile
+98-0clang/test/CIR/CodeGen/global-init-fn-strictfp.cpp
+38-0clang/test/CIR/Transforms/lowering-prepare-strictfp.cir
+35-0clang/test/CIR/CodeGen/cxx20-module-initializer-strictfp.cppm
+14-10clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+11-2clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+2-6clang/lib/CIR/CodeGen/CIRGenCXX.cpp
+198-183 files not shown
+200-289 files

LLVM/project 1d0a942 — llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize interleave_uncountable_exits.ll

[VPlan] Move extract-lane(0, canWideIV) combine before unrolling

Some extract-lane combines can't be performed before unrolling, e.g. the one that combines it to Instruction::ExtractElement can end up extracting from a different part. But the extract-lane(0, canWideIV) can because at index 0 you're always extracting from the first part. Do this before unrolling, which improves codegen of unrolled code.
DeltaFile
+171-5llvm/test/Transforms/LoopVectorize/AArch64/early_exit_with_stores_neon.ll
+16-24llvm/test/Transforms/LoopVectorize/VPlan/early_exit_with_stores_vplan.ll
+4-12llvm/test/Transforms/LoopVectorize/interleave_uncountable_exits.ll
+6-6llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+197-474 files

LLVM/project de4b4e6 — llvm/test/Transforms/LoopVectorize/AArch64 early_exit_with_stores_neon.ll

Precommit test
DeltaFile
+49-0llvm/test/Transforms/LoopVectorize/AArch64/early_exit_with_stores_neon.ll
+49-01 files

LLVM/project 85f7ef2 — llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize early-exit-tail-folding.ll

[VPlan] Remove header masks whose tail lanes aren't used

Replace a use of header-mask && x with x if the user, transitively
through freeze, logical-and, not and mask.beforefirst(freeze ...), only
reaches masks that are and'ed with the header mask again. The header
mask is a prefix and lane i of mask.beforefirst only depends on lanes
0..i, so the lanes outside of the header mask are never used.

This avoids the i1 vp.merge that EVL tail folding needs for the inner
header mask, e.g. in the early exit mask.beforefirst(freeze(header-mask
&& c)) and in switch default edges.
DeltaFile
+39-0llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+2-4llvm/test/Transforms/LoopVectorize/early-exit-tail-folding.ll
+2-4llvm/test/Transforms/LoopVectorize/RISCV/early_exit_with_stores.ll
+2-4llvm/test/Transforms/LoopVectorize/RISCV/early-exit.ll
+1-2llvm/test/Transforms/LoopVectorize/RISCV/zvl1024b-crash.ll
+46-145 files

LLVM/project cc642fd — llvm/lib/Transforms/Vectorize LoopVectorizationLegality.cpp LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize early_exit_store_legality.ll early-exit-tail-folding.ll

[VPlan] Allow tail folding early exits with side effects

Continues the work in #179595.

This allows us to tail fold e.g. the following loop:

```c
extern char a[1024], b[1024], c[1024], y[1024];
void two_guards(void) {
  for (int i = 0; i < 1000; i++) {
    if (a[i] == 0)
      break;
    if (b[i] > 3) {
      if (c[i] < 9)
        y[i] = 1;
    }
  }
}
```

    [30 lines not shown]
DeltaFile
+40-70llvm/test/Transforms/LoopVectorize/early-exit-tail-folding.ll
+24-41llvm/test/Transforms/LoopVectorize/RISCV/early_exit_with_stores.ll
+18-35llvm/test/Transforms/LoopVectorize/RISCV/early-exit.ll
+24-0llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+0-7llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+2-2llvm/test/Transforms/LoopVectorize/early_exit_store_legality.ll
+108-1552 files not shown
+111-1578 files

LLVM/project 464de2d — llvm/test/Transforms/LoopVectorize early-exit-tail-folding.ll

Precommit tests
DeltaFile
+214-153llvm/test/Transforms/LoopVectorize/early-exit-tail-folding.ll
+214-1531 files

LLVM/project 419c849 — llvm/lib/Transforms/Vectorize VPlanConstruction.cpp, llvm/test/Transforms/LoopVectorize multiple-early-exits.ll early-exit-tail-folding.ll

[VPlan] Support tail folding uncountable early exits

Enables the first step towards #179595. After #237254, the MaskedHandleExitInVectorLoop early exit style uses the CFG to handle masking for early exit loops. This allows it to compose with tail folding which is also handled via the CFG in #176143.

This allows us to tail fold the following loop:

```c
extern char x[256];
int f(char * restrict y) {
  for (int i = 0; i < 256; i++) {
    if (x[i] == 0)
      return i;
  }
  return -1;
}
```

Into this on RISC-V:


    [18 lines not shown]
DeltaFile
+88-160llvm/test/Transforms/LoopVectorize/RISCV/early-exit-live-out.ll
+77-149llvm/test/Transforms/LoopVectorize/RISCV/early-exit.ll
+54-105llvm/test/Transforms/LoopVectorize/early-exit-tail-folding.ll
+108-16llvm/test/Transforms/LoopVectorize/multiple-early-exits.ll
+20-37llvm/test/Transforms/LoopVectorize/RISCV/sink-to-early-exit.ll
+32-18llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+379-4854 files not shown
+411-49310 files

LLVM/project bf3ca8e — llvm/test/Transforms/LoopVectorize early-exit-tail-folding-active-lane-mask.ll early-exit-tail-folding.ll, llvm/test/Transforms/LoopVectorize/RISCV early-exit.ll

Precommit tests
DeltaFile
+552-0llvm/test/Transforms/LoopVectorize/RISCV/early-exit.ll
+524-0llvm/test/Transforms/LoopVectorize/early-exit-tail-folding.ll
+65-0llvm/test/Transforms/LoopVectorize/early-exit-tail-folding-active-lane-mask.ll
+1,141-03 files

LLVM/project 10dfb57 — llvm/lib/Transforms/Vectorize VPlanConstruction.cpp LoopVectorize.cpp

[VPlan] Use vputils::findCanonicalIVIncrement in more places. NFC

In a future patch we want to enable more scenarios with early exits and tail folding. In these scenarios the terminator will no longer be a BranchOnCount/BranchOnCond but a BranchOnTwoConds, so a bunch of canonical IV matchers break. Use vputils::findCanonicalIVIncrement instead since it searches the users of the canonical IV instead of looking at the terminator.
DeltaFile
+7-13llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
+2-9llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+2-8llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+11-303 files

LLVM/project 2e75744 — llvm/test/Transforms/LoopVectorize early_exit_with_stores.ll

Precommit tests
DeltaFile
+221-0llvm/test/Transforms/LoopVectorize/early_exit_with_stores.ll
+221-01 files

LLVM/project 277de7c — llvm/lib/Transforms/Vectorize VPlan.h VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize early_exit_with_stores.ll

[VPlan] Allow early exit loops with side effects by masking in the vector loop.

When all blocks with side effects are dominated by every early exit, we can vectorize the loop if we mask off any lanes past the exit. We can do this with control flow:

```mermaid
flowchart TD
  header --> exiting
  exiting -->| exit mask | sideeffects --> latch --> latch.split
  exiting -->| !exit mask | latch.split
```

For every early exiting block we add a branch to the latch on `!mask.beforefirst(exitcond)`. This is implemented in UncountableExitStyle::ReadOnly which is now renamed to MaskedHandleExitInVectorLoop.

This is a complementary exit style to MaskedHandleExitInScalarLoop. If any of the side effects aren't dominated by the early exit it still falls back to the scalar loop style, which is why none of the existing early exit side effect tests changed. Masking in loop is profitable for RISC-V and I'm assuming it's also profitable for AArch64 too, but if not then we can add a TTI hook for a preferred exit style.
DeltaFile
+59-76llvm/test/Transforms/LoopVectorize/early_exit_with_stores.ll
+86-33llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+10-9llvm/test/Transforms/LoopVectorize/X86/early_exit_with_stores.ll
+8-7llvm/test/Transforms/LoopVectorize/RISCV/early_exit_with_stores.ll
+5-4llvm/lib/Transforms/Vectorize/VPlan.h
+3-2llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
+171-1312 files not shown
+176-1338 files

LLVM/project 35be028 — llvm/lib/Transforms/Vectorize VPlanVerifier.cpp VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize predicated-single-exit.ll predicated-early-exits-interleave.ll

[VPlan] Preserve SSA in early exit loops

MaskedCond is used to logically-and the condition to early exit with the current block in-mask. However because we use it in the latch block where the condition isn't defined on all paths, we have to workaround it not being in SSA in the verifier.

This fixes this by using reconstructSSA added in #212209 to preserve SSA in both the exit conditions and live outs in the exit blocks. It also means we get the right exit condition without MaskedCond and allows us to remove the MaskedCond exceptions in the verifier. MaskedCond is still kept since a followup PR will still use it.

One subtle point is that we need to freeze any branch conditions. Any lanes after and including the early exiting lane might contain poison and we can have branches on those poison lanes that didn't we didn't previously branch on in the scalar loop.

There's no miscompile on main today because we coincidentally don't keep SSA so exit conditions are read directly without being polluted by poison stemming from a branch past the early exit. But in this PR the exit conditions are polluted and we can end up with poison in the condition operand of a select, which causes an undefined result for AnyOf even if it freezes its operand. The poison in the branch will also cause problems in future if we decide to preserve uniform control flow and emit branches instead of blends. The exit_cond_merged_after_poison_branch test illustrates this.
DeltaFile
+156-36llvm/test/Transforms/LoopVectorize/predicated-multiple-exits.ll
+24-16llvm/test/Transforms/LoopVectorize/predicated-early-exits-interleave.ll
+26-9llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-18llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+12-6llvm/test/Transforms/LoopVectorize/predicated-single-exit.ll
+219-855 files

LLVM/project 3efbeb1 — llvm/unittests/Transforms/Vectorize VPlanVerifierTest.cpp

Remove old dominance unit test
DeltaFile
+0-18llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp
+0-181 files

LLVM/project 04c8fb1 — llvm/lib/Transforms/Vectorize VPlanPredicator.cpp, llvm/test/Transforms/LoopVectorize uniform-blend.ll select-cmp-blend-chain.ll

[VPlan] Peek through nested phi incoming values in computeBlendMasks
DeltaFile
+495-0llvm/test/Transforms/LoopVectorize/predicator.ll
+389-6llvm/test/Transforms/LoopVectorize/VPlan/predicator.ll
+80-11llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+81-0llvm/test/Transforms/LoopVectorize/find-last.ll
+13-3llvm/test/Transforms/LoopVectorize/select-cmp-blend-chain.ll
+3-12llvm/test/Transforms/LoopVectorize/uniform-blend.ll
+1,061-326 files

LLVM/project b7905da — llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize blend-i1.ll

[VPlan] Simplify BLEND X/M, false, ..., false -> M && X

If an i1 blend has false for all but one incoming value, then we can simplify this to the one non-false value. Blends by construction never have any overlapping mask values, so we don't need to worry about the order as the masks can't "shortcut" each other.
DeltaFile
+13-0llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+3-8llvm/test/Transforms/LoopVectorize/blend-i1.ll
+16-82 files

LLVM/project 5a0e093 — llvm/test/Transforms/LoopVectorize blend-i1.ll

Precommit tests
DeltaFile
+69-0llvm/test/Transforms/LoopVectorize/blend-i1.ll
+69-01 files

LLVM/project c0bc170 — llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize interleave_uncountable_exits.ll

[VPlan] Move extract-lane(0, canWideIV) combine before unrolling

Some extract-lane combines can't be performed before unrolling, e.g. the one that combines it to Instruction::ExtractElement can end up extracting from a different part. But the extract-lane(0, canWideIV) can because at index 0 you're always extracting from the first part. Do this before unrolling, which improves codegen of unrolled code.
DeltaFile
+16-24llvm/test/Transforms/LoopVectorize/VPlan/early_exit_with_stores_vplan.ll
+4-12llvm/test/Transforms/LoopVectorize/interleave_uncountable_exits.ll
+6-6llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+26-423 files

LLVM/project c1d592f — clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp, clang/test/CIR/CodeGen strictfp-call-site.cpp strictfp-call-site.c

[CIR] Mark calls in strictfp functions strictfp

LangRef requires every call in a function that uses constrained FP
intrinsics to be `strictfp`, at the call site or on the callee, and
LLVM checks the call, not its caller, before it folds or simplifies a
libcall. Classic codegen gets the attribute from IRBuilder's
constrained mode. ClangIR marked only the function, so at -O1 LLVM
folded `erf(1.0)` to a constant under `FENV_ACCESS ON`.

After the conversion to the LLVM dialect, the lowering now sets
`strictfp` on every `llvm.call`, `llvm.invoke`, `llvm.inline_asm` and
`llvm.call_intrinsic` in a `strictfp` function. That covers direct and
indirect calls, invokes, inline assembly, constrained intrinsics, and
the calls that LoweringPrepare and EH lowering create. CIR does not
change, `strictfp` stays a function attribute. The marks are part of
the LLVM dialect, so they survive any route to LLVM IR.

Calls from named intrinsic ops such as `llvm.intr.fabs` and
`llvm.intr.memcpy` stay unmarked, because the LLVM dialect has no

    [9 lines not shown]
DeltaFile
+118-0clang/test/CIR/CodeGen/strictfp-call-site.c
+115-0clang/test/CIR/Lowering/strictfp-call-site.cir
+86-0clang/test/CIR/CodeGen/strictfp-call-site.cpp
+32-0clang/test/CIR/Lowering/strictfp-call-site-asm.cir
+22-0clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+373-05 files

LLVM/project 94affbf — mlir/include/mlir/Dialect/LLVMIR LLVMOps.td, mlir/lib/Dialect/LLVMIR/IR LLVMCallOps.cpp

[mlir][LLVM] Add strictfp to call, invoke, inline_asm and call_intrinsic

In a function that uses constrained floating-point intrinsics, LLVM
requires every call to be `strictfp`, at the call site or on the callee,
and its folders check the call before they fold or simplify a libcall.
The LLVM dialect could mark only the function, through `passthrough`, so
a frontend lowering to it had no way to mark its calls.

This adds a `strictfp` unit attribute to `llvm.call`, `llvm.invoke`,
`llvm.inline_asm` and `llvm.call_intrinsic`, the ops that model
call-site function attributes, like `convergent` and `nobuiltin`. Export
turns it into the call-site `strictfp` attribute and import reads it
back. Calls of the constrained intrinsic ops already get the attribute
from IRBuilder. Other named intrinsic ops have no call-site attributes.

Assisted-by: Claude Code (Opus 5.5).
DeltaFile
+40-0mlir/test/Target/LLVMIR/llvmir.mlir
+24-0mlir/test/Target/LLVMIR/Import/instructions.ll
+24-0mlir/test/Dialect/LLVMIR/roundtrip.mlir
+15-3mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+10-7mlir/lib/Dialect/LLVMIR/IR/LLVMCallOps.cpp
+12-0mlir/test/Target/LLVMIR/Import/intrinsic-unregistered.ll
+125-103 files not shown
+139-119 files

LLVM/project dcc0128 — utils/bazel/llvm-project-overlay/llvm BUILD.bazel

[Bazel] Fixes 6e144d9 (#246241)

This fixes 6e144d9372f2169817e07f6a828438ec0880f34f (#223745).

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

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+23-3utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+23-31 files

LLVM/project 77d6721 — flang-rt/unittests/Runtime Namelist.cpp, flang/include/flang/Support Fortran-features.h

[flang] Fix value separators for CHARACTER array output (#205303)

Fixes #192936

Undelimited character values in namelist output might not be readable as
namelist input (F'2018 13.11.4.2 NOTE 1). Emit a warning for namelist
WRITE/PRINT when a group item has CHARACTER data and DELIM= is absent or
'NONE'. DELIM='NONE' runtime output is unchanged, and a runtime test is
added for DELIM='QUOTE' namelist output and read-back.
The warning is enabled by default since the affected users are the ones
who would not opt in; it can be disabled with
-Wno-undelimited-namelist-character.
DeltaFile
+63-0flang/test/Semantics/io20.f90
+43-0flang/lib/Semantics/check-io.cpp
+31-0flang-rt/unittests/Runtime/Namelist.cpp
+3-1flang/lib/Semantics/check-io.h
+2-1flang/include/flang/Support/Fortran-features.h
+3-0flang/unittests/Common/FortranFeaturesTest.cpp
+145-21 files not shown
+146-27 files