LLVM/project e973b0cllvm/lib/CodeGen MachinePipeliner.cpp

MachinePipeliner: Pass instruction to findLoopIncrementValue (#219966)

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 fa1857eflang/lib/Semantics check-allocate.cpp, flang/test/Semantics/CUDA cuf32.cuf

[flang][cuda] Reject DEVICE derived types with attributed allocatable components (#220411)

CUDA attributed allocatables are allocated from the host in most case
(PINNED, MANAGED, UNIFIED). A DEVICE derived-type object keeps its
component descriptors in device global memory, so allocating such a
component is not valid. It's also invalid for a DEVICE component unless
the allocate statement is in device context.
DeltaFile
+123-0flang/test/Semantics/CUDA/cuf32.cuf
+27-0flang/lib/Semantics/check-allocate.cpp
+150-02 files

LLVM/project 11f9ddfllvm/lib/Transforms/Vectorize VPlanUtils.h VPlanUtils.cpp

[VPlan] Allow non-live-in start values for widened inductions (NFC). (#220716)

Prepare VPWidenIntOrFpInductionRecipe for modeling the full epilogue
skeleton and resume values properly, by removing the VPIRValue
requirement for the start value.

The only requirement for the start value is that it dominates the phi,
which the verifier already ensures.

This is NFC today, but prepares for modeling the full epilogue skeleton
in VPlan, which requires adding phi nodes in the preheader before
execute.
DeltaFile
+6-6llvm/lib/Transforms/Vectorize/VPlan.h
+2-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-1llvm/lib/Transforms/Vectorize/VPlanUtils.h
+1-1llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+1-1llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+11-115 files

LLVM/project fbe9a26flang/lib/Semantics check-omp-structure.h check-omp-structure.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability-openmp-60.f90 metadirective-loop-applicability-apply.f90

[flang][OpenMP] Track reachable metadirective replacement paths

The existing semantic checks can validate loop-associated directives in a
METADIRECTIVE against the following loop, but they do not model how the
METADIRECTIVE chooses among its replacements.

Today each WHEN is considered independently: if its selector can match, its
replacement is checked. Selection instead ranks all applicable candidates as
a set. An unguarded higher-ranked candidate makes lower-ranked candidates
unreachable, while a dynamically guarded candidate leaves them reachable
when its condition is false. Treating both cases alike can diagnose loop
requirements on a replacement that can never be selected.

The selected replacement can also affect later selection. Its directive
contributes to the construct context seen by a nested metadirective. The
checker currently retains only syntactic nesting, so nested construct
selectors cannot observe a directive selected by an enclosing
metadirective.


    [44 lines not shown]
DeltaFile
+345-95flang/lib/Semantics/check-omp-variant.cpp
+186-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+56-25flang/lib/Semantics/check-omp-structure.cpp
+37-13flang/lib/Semantics/check-omp-structure.h
+23-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-apply.f90
+13-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-openmp-60.f90
+660-1332 files not shown
+665-1348 files

LLVM/project e6734a4libcxx/include/__algorithm pstl.h, libcxx/include/__pstl/backends serial.h

[libc++][pstl] Implementation of parallel std::find_end() based on __parallel_find() (#218321)

This PR implements a parallel version of `std::find_end()` based on
`__parallel_find()`.

The algorithm crops the input range to a range where a potential match
can start and runs a chunked parallel find on the cropped range.
Inside each chunk potential matches are looked for using the serial
`std::find_end()` and the last one found is returned.
Since it's based on `__parallel_find()`, the algorithm supports early
termination.

Part of #99938.
DeltaFile
+276-0libcxx/test/std/algorithms/alg.nonmodifying/alg.find.end/pstl.find_end_pred.pass.cpp
+268-0libcxx/test/std/algorithms/alg.nonmodifying/alg.find.end/pstl.find_end.pass.cpp
+102-0libcxx/include/__pstl/cpu_algos/find_end.h
+48-0libcxx/include/__algorithm/pstl.h
+16-0libcxx/include/__pstl/backends/serial.h
+14-0libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp
+724-08 files not shown
+762-014 files

LLVM/project 0d45751clang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td CIRTypes.td

[CIR] Use the modern enum case classes

The `I32EnumAttrCase` family carries an `Attr` half, and an `IntegerAttr`
predicate with it, that a CIR enum has no use for now that the enums derive
from `EnumInfo`. Upstream says of those forms that they "are not needed when
using the newer `EnumCase` form".

Rename all 198 of them to `I32EnumCase`, `I32BitEnumCaseNone`,
`I32BitEnumCaseBit` and `BitEnumCaseGroup`. The group class drops its width
prefix because the modern spelling takes the width from its cases.

NFC, mechanical.
DeltaFile
+140-140clang/include/clang/CIR/Dialect/IR/CIROps.td
+43-43clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+8-8clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+4-4clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+3-3clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+198-1985 files

LLVM/project 06c3377clang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td

[CIR] Record why the CUDA registration attribute parses itself

hasCustomAssemblyFormat with no explanation invites the question of whether a
declarative assemblyFormat would do. It would not. The three flags print as
presence-only keywords and parse in any order, while an optional group
anchored on a `bool` parameter parses and prints a value, so the group would
spell `extern true`. MLIR has no presence-only flag for `bool` in an
attribute format, unlike UnitAttr in an operation format. struct(params)
round-trips but spells the attribute
`<device_side_name = "i", kind = Variable, isExtern = true>` instead of
`<i, Variable, extern>`.

NFC.
DeltaFile
+5-0clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+5-01 files

LLVM/project 6243b33clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/test/CIR/CodeGen callsite-inline-attributes.cpp

[CIR] Drop the redundant suffix from the inline kind mnemonic

inline_kind was the one CIR enum attribute mnemonic still repeating what its
C++ enum class name says. The attribute now spells
`#cir.inline<always_inline>`. The operation argument keeps the name
inline_kind, since that is the accessor name, so the printed form reads
`inline_kind = #cir.inline<always_inline>`.

The enum's summary also becomes "inline kind" rather than the camelCase
"inlineKind", which is what generated docs show now that CIR_InlineKindAttr
no longer overrides it.

25 CHECK lines change across four test files. Nine are in an
aarch64-registered-target test, unsupported in an X86-only build, but the
substitution matches the two CIR tests that do run.
DeltaFile
+9-9clang/test/CodeGen/AArch64/sme-inline-callees-streaming-attrs.c
+9-9clang/test/CIR/CodeGen/callsite-inline-attributes.cpp
+6-6clang/test/CIR/IR/inline-attrs.cir
+2-3clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+2-2clang/test/CIR/IR/invalid-call.cir
+28-295 files

LLVM/project 2e1a4f0clang/utils/TableGen CIRLoweringEmitter.cpp

[CIR] Derive lowering attr names from cppClassName, not the def name

CIRLoweringEmitter built its CXX_ABI_ALWAYS_LEGAL_ATTRS entries with
GetOpCppClassName, which splits the TableGen def name at the first
underscore. That works only while every def is named CIR_<CppClassName>Attr.
When one is not, the emitter writes an `isa<>` for a class that does not
exist, and the failure lands as a compile error in generated code.

Attributes carry the authoritative name in cppClassName, which
GenerateAttrToValueVisitor was already reading. Factor that out as
GetAttrCppClassRef and use it for both attribute paths. GetOpCppClassName
stays for operations.

NFC, and checkable. No CIR attribute overrides cppClassName, so the generated
CIRLowering.inc is byte-identical.
DeltaFile
+16-10clang/utils/TableGen/CIRLoweringEmitter.cpp
+16-101 files

LLVM/project 9532231clang/include/clang/CIR/Dialect/IR CIREnumAttr.td CIROps.td

[CIR] Drop dead ceremony around the CIR enum attributes

Five things that no longer earn their place in the CIR enum attribute
machinery.

CIR_CleanupKindAttr carried three. Its cppClassName restated the default
AttrDef already derives. Its skipDefaultBuilders plus hand-written
AttrBuilder existed only to default $value to CleanupKind::All, which no
caller relies on, so the generated builders stayed suppressed for nothing.
And its summary and description restated the name, overriding the enum's own
"cleanup kind" that EnumAttr would otherwise inherit. The isNormal, isEH and
isNormalAndEH helpers stay.

CIR_TLSModelAttr's summary restated its name the same way, so only that goes.
CIR_DefaultValuedEnumParameter has never had a user.

NFC.
DeltaFile
+0-16clang/include/clang/CIR/Dialect/IR/CIROps.td
+0-5clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+0-212 files

LLVM/project dbeff05clang/include/clang/CIR/Dialect/IR CIRTypes.td CIRCUDAAttrs.td, clang/test/CIR/IR invalid-call.cir

[CIR] Move the CIR enums off the legacy EnumAttrInfo hierarchy

MLIR has two enum hierarchies. `EnumAttrInfo` doubles as an `IntegerAttr`
constraint, so every CIR enum had to clear `genSpecializedAttr` to say it did
not want one. `EnumInfo` describes a C++ enum and nothing more.

Derive the CIR bases from `I32Enum`, `I64Enum` and `I32BitEnum`, and widen
`CIR_EnumAttr` to the `EnumInfo` that upstream `EnumAttr` already takes. The
flag no longer exists to clear. `FPClassTestEnum` gets unquoted printing from
`BitEnumBase` rather than overriding `printBitEnumQuoted`, and
`CIR_KnownFuncKind` drops a `parameterPrinter` the generated `operator<<`
now covers, still spelling `#cir.func_identity<"std::find">`.

AMDGPU wraps an `I32Enum` in an `EnumAttr` with this same bracketed format.
Parsing moves to the generated `FieldParser`, whose diagnostic names the
accepted spellings, so two `expected-error` lines change. Generated attribute
code drops 16 KB as 28 inlined parsers collapse into it.
DeltaFile
+33-73clang/include/clang/CIR/Dialect/IR/CIROps.td
+23-53clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+13-9clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+2-4clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+1-3clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+1-1clang/test/CIR/IR/invalid-call.cir
+73-1431 files not shown
+74-1447 files

LLVM/project 9516b3eclang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/CodeGenBuiltins builtin-isinf-sign.c builtin-isfpclass.c

[CIR] Migrate the FPClassTest bit enum and unquote its flags

cir.is_fp_class printed its flags inconsistently. Single-bit values came out
bare, as in `fcSNan`, while group values and combinations came out quoted, as
in `"fcInf"` and `"fcSNan|fcNegInf"`. That comes from I32BitEnumAttr setting
printBitEnumQuoted, which EnumAttr.td keeps only for backwards compatibility.

Clearing the bit and using the `enum` directive selects the separator-aware
parser and printer, so every value now spells unquoted:

  cir.is_fp_class %x, fcSNan|fcNegInf : (!cir.float) -> !cir.bool

The enum also drops its specialized IntegerAttr for a CIR_EnumAttr wrapper,
giving it the standalone spelling `#cir.fp_class<fcSNan|fcNegInf>`. This
changes operation syntax, so it updates 37 CHECK lines.
DeltaFile
+20-20clang/test/CIR/CodeGenBuiltins/builtin-fpclassify.c
+16-16clang/test/CIR/CodeGenBuiltins/builtin-isfpclass.c
+18-2clang/test/CIR/IR/enum-attrs.cir
+12-2clang/include/clang/CIR/Dialect/IR/CIROps.td
+1-1clang/test/CIR/CodeGenBuiltins/builtin-isinf-sign.c
+67-415 files

LLVM/project 536a561clang/include/clang/CIR/Dialect/IR CIRAttrs.td CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate GlobalLinkageKind, CallingConv and SideEffect off IntegerAttr

GlobalLinkageKind, CallingConv and SideEffect generated IntegerAttr
subclasses with no dialect spelling of their own. Each now sets
genSpecializedAttr = 0 and gains a CIR_EnumAttr wrapper, and cir.global wraps
$linkage in `enum()`. GlobalLinkageKind spells `#cir.linkage<internal>`,
dropping both the `global_` prefix and the `_kind` suffix.

cir.func and cir.call print all three by hand, but they stream
stringifyGlobalLinkageKind(getLinkage()) and friends, which take the enum
rather than the attribute, so those sites are unchanged.

Operation syntax is unchanged.
DeltaFile
+31-0clang/test/CIR/IR/enum-attrs.cir
+17-8clang/include/clang/CIR/Dialect/IR/CIROps.td
+4-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+52-83 files

LLVM/project a559ee4clang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate AssumeBundleKind, AtomicFetchKind and AsmFlavor off IntegerAttr

AssumeBundleKind, AtomicFetchKind and AsmFlavor generated IntegerAttr
subclasses with no dialect spelling of their own. Each now sets
genSpecializedAttr = 0 and gains a CIR_EnumAttr wrapper.

Unlike the other CIR operation enums, these three are reached through
hand-written parsers and printers, so they needed checking individually.
cir.atomic.fetch references $binop declaratively and gains an `enum()`
wrapper. The other two need no change, since printAssumeBundle is already
typed on cir::AssumeBundleKindAttr and InlineAsmOp::print streams the enum
rather than the attribute.

Operation syntax is unchanged.
DeltaFile
+28-0clang/test/CIR/IR/enum-attrs.cir
+19-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+47-62 files

LLVM/project 8fb3023clang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate MemOrder and SyncScopeKind off IntegerAttr

MemOrder and SyncScopeKind, the enums the atomic operations share, generated
IntegerAttr subclasses with no dialect spelling of their own.

Both now set genSpecializedAttr = 0 and gain CIR_EnumAttr wrappers, spelling
`#cir.mem_order<seq_cst>` and `#cir.sync_scope<system>`, and the atomic
operations wrap their arguments in `enum()` to keep the bare keyword.

`enum()` works as an optional-group anchor, so the `syncscope` and `atomic`
groups on cir.load and cir.store are unaffected. Operation syntax is
unchanged.
DeltaFile
+38-30clang/include/clang/CIR/Dialect/IR/CIROps.td
+24-2clang/test/CIR/IR/enum-attrs.cir
+62-322 files

LLVM/project 83bfbdfclang/include/clang/CIR/Dialect/IR CIRCUDAAttrs.td CIROps.td, clang/test/CIR/IR enum-attrs.cir

[CIR] Migrate seven operation enums off IntegerAttr

CastKind, DynamicCastKind, CmpOpKind, ComplexRangeKind, InitCatchKind,
CaseOpKind and AwaitKind generated IntegerAttr subclasses. The operations
printed them symbolically, but in an attribute dictionary `cir.cast bitcast`
was stored as `kind = 1 : i32`.

Each enum now sets genSpecializedAttr = 0 and gains a CIR_EnumAttr wrapper,
and the operations wrap the argument in `enum()` to keep the bare keyword,
giving spellings like `#cir.cast<bitcast>`. Mnemonics drop the suffix the C++
class name carries. DynamicCastKind spells out `dynamic_cast`, since
`dyn_cast` is taken by the operation and by `#cir.dyn_cast_info`.

CUDADeviceVarKind gets no wrapper, being only a raw parameter of
CIR_CUDAVarRegistrationInfoAttr.

Operation syntax is unchanged, and enum-attrs.cir covers the new spellings.
DeltaFile
+86-0clang/test/CIR/IR/enum-attrs.cir
+57-25clang/include/clang/CIR/Dialect/IR/CIROps.td
+4-3clang/include/clang/CIR/Dialect/IR/CIRCUDAAttrs.td
+147-283 files

LLVM/project ee9a0a0clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenModule.h CIRGenModule.cpp

[CIR] Delete the unused cir::VisibilityAttr

CIR_VisibilityAttr had no users. `cir.global` and `cir.func` carry visibility
as `EnumProp<CIR_VisibilityKind>`, a property rather than an attribute, so
nothing ever built or printed the attribute.

Its only consumer was CIRGenModule::getGlobalVisibilityAttrFromDecl, itself
never called, and that was the only caller of
getGlobalVisibilityKindFromClangVisibility, so all three go together. The
similar getCIRVisibilityKind does have a caller and stays, as does
CIR_VisibilityKind, which the property is built from.

This also removes one of the two attributes overriding their assembly format
to a bare `$value`.
DeltaFile
+1-28clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+0-26clang/lib/CIR/CodeGen/CIRGenModule.cpp
+0-3clang/lib/CIR/CodeGen/CIRGenModule.h
+1-573 files

LLVM/project 5bc6917clang/lib/CIR/Dialect/IR CIRDialect.cpp CIRAttrs.cpp, clang/test/CIR/CodeGenOpenCL kernel-arg-info.cl

[CIR] Drop lang_address_space's custom parenthesized attribute format

CIR_LangAddressSpaceAttr overrode its assembly format to
`(` custom<AddressSpaceValue>($value) `)`. The parentheses defeated the
dialect's `#cir.mnemonic<...>` syntax, so the attribute printed as
`#cir<lang_address_space(offload_global)>`. It now uses the bracketed
CIR_EnumAttr default and spells `#cir.lang_address_space<offload_global>`.

The `lang_address_space(x)` spelling inside `!cir.ptr` and `cir.global` is
unaffected, since that goes through MemorySpaceAttrInterface in CIRTypes.cpp.
The attribute-level pair in CIRAttrs.cpp was only reachable from the deleted
format, so it goes away.

That left the CIRTypes.cpp pair sharing a name with the deleted enum hooks,
which reads as duplicated logic even though the two are unrelated: these take
a mlir::ptr::MemorySpaceAttrInterface and dispatch over LangAddressSpaceAttr
and TargetAddressSpaceAttr to spell the address space nested in a type or op,
so no ODS default could replace them. Rename them to
parseMemorySpace/printMemorySpace, matching MemorySpaceAttrInterface and

    [4 lines not shown]
DeltaFile
+16-23clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+14-14clang/test/CIR/CodeGenOpenCL/kernel-arg-info.cl
+0-20clang/lib/CIR/Dialect/IR/CIRAttrs.cpp
+6-6clang/test/CIR/IR/invalid-opencl-kernel-arg-metadata.cir
+4-4clang/test/CIR/IR/opencl-kernel-arg-metadata.cir
+4-4clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+44-715 files not shown
+51-8211 files

LLVM/project d15ae0aclang/test/CIR/CodeGen global-tls-dynamic-vs-static.cpp global-tls-dyn-init.cpp

[CIR] Print cir.global's TLS model without naked angle brackets

`cir.global` printed `tls_model = <tls_dyn>`. Those brackets were the
leftover delimiters of `#cir.tls_model<tls_dyn>` after the printer stripped
the dialect prefix and mnemonic, so one enum had two spellings and the
per-global one was not something anyone would write by hand.

Wrapping the argument in the `enum` directive prints the symbolic value on
its own:

  cir.global external tls_model = tls_dyn @a = #cir.int<5> : !s32i

The standalone attribute is unchanged. invalid-tls.cir now gets one
diagnostic from the enum parser instead of two.
DeltaFile
+24-24clang/test/CIR/CodeGen/tls-model.cpp
+16-16clang/test/CIR/CodeGen/tls-model-func-scope.cpp
+14-14clang/test/CIR/CodeGen/global-tls-simple-init.cpp
+13-13clang/test/CIR/CodeGen/thread-local-in-func.cpp
+9-9clang/test/CIR/CodeGen/global-tls-dynamic-vs-static.cpp
+9-9clang/test/CIR/CodeGen/global-tls-dyn-init.cpp
+85-856 files not shown
+113-11412 files

LLVM/project 5d11679clang/include/clang/CIR/Dialect/IR CIREnumAttr.td CIROps.td, clang/test/CIR/IR invalid-loop-cleanup.cir cleanup-scope.cir

[CIR] Give the cleanup kind a proper standalone attribute spelling

CleanupKindAttr overrode its assembly format to a bare `$value` so
`cir.cleanup.scope` would print `cleanup all`. The cost was that the
attribute had no readable standalone form, falling back to
`#cir<cleanup_kind all>`.

The `enum($attr)` operation directive removes the tradeoff. The attribute
keeps CIR_EnumAttr's bracketed default and now spells `#cir.cleanup<all>`,
while the operations ask for the bare keyword. The mnemonic drops the `_kind`
suffix the C++ class name carries.

Operation syntax is unchanged. invalid-loop-cleanup.cir now gets one
diagnostic from the enum parser instead of two.
DeltaFile
+21-0clang/test/CIR/IR/cleanup-scope.cir
+4-8clang/include/clang/CIR/Dialect/IR/CIROps.td
+2-4clang/test/CIR/IR/invalid-loop-cleanup.cir
+5-0clang/include/clang/CIR/Dialect/IR/CIREnumAttr.td
+32-124 files

LLVM/project 5f47cb6clang/docs ReleaseNotes.md, clang/lib/Sema TreeTransform.h

[clang] Clean up switch stack when transforming an invalid body (#211162)

This PR resolves https://github.com/llvm/llvm-project/issues/210575.

Call RebuildSwitchStmt() irrespective of whether the body was succesfully
transformed to make sure we always pop an entry off the switch stack.

Assisted-by: OpenAI Codex
DeltaFile
+10-0clang/test/SemaCXX/cxx2c-expansion-stmts-control-flow.cpp
+3-0clang/docs/ReleaseNotes.md
+0-2clang/lib/Sema/TreeTransform.h
+13-23 files

LLVM/project 77daeaellvm/lib/Transforms/InstCombine InstCombineSelect.cpp, llvm/test/Transforms/InstCombine logical-select.ll

[InstCombine] Don't assume a trunc with nsw is never poison (#220930)

`impliesPoisonOrCond()` treats `trunc nuw X to i1` as never poison when
`X` is known to be in `[0, 1]`, which makes the assumed-poison premise
vacuously true and folds a logical and/or into a bitwise one.

`m_NUWTrunc()` matches on a flag subset, so it also matches `trunc nuw
nsw`. Such a trunc is still poison for `X == 1`, because `nsw` requires
the truncated bits to equal the top bit of the result, and they are zero
while the result is one. For `%c = false` and `%x = 1` the source
returns `false` while the folded form returns `poison`:
https://alive2.llvm.org/ce/z/Q6G5-v

None of the remaining `m_NUWTrunc()` users assumes that the matched
trunc is non-poison, so they are unaffected.

Fixes #220487.
DeltaFile
+33-0llvm/test/Transforms/InstCombine/logical-select.ll
+3-0llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+36-02 files

LLVM/project c0274ffllvm/lib/Target/X86 X86RegisterInfo.cpp, llvm/test/CodeGen/X86 avx512f-large-stack.ll huge-frame-index.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+53-0llvm/test/CodeGen/X86/huge-frame-index.ll
+13-1llvm/lib/Target/X86/X86RegisterInfo.cpp
+2-1llvm/test/CodeGen/X86/avx512f-large-stack.ll
+68-23 files

LLVM/project e63a6e2clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorRegions across region-branch ops

Six of the ten CIR ops implementing RegionBranchOpInterface reported the same
successors: any of their regions may be entered from the parent operation, and
every region exit goes back to it. Add a CIR_EnterAnyRegionBranchOpBase class
that appends that definition to the one inherited from CIR_RegionBranchOpBase,
retarget the six ops onto it and delete their hand-written definitions.

The shared definition walks getRegions() rather than naming region accessors.
For all six ops the entry regions were exactly the declared regions in
declaration order, so it reports the same successors in the same order. The doc
comments of the deleted ScopeOp and TernaryOp definitions go with them, instead
of being left behind on the neighbouring builders.

IfOp, GlobalOp, TryOp and AwaitOp stay on the base class, since their successors
depend on the operation: IfOp falls back to the parent when the else region is
empty, GlobalOp skips its optional ctor and dtor regions, TryOp iterates
variadic handler regions, and AwaitOp routes ready to resume and suspend.
DeltaFile
+0-77clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+27-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+27-832 files

LLVM/project aa568b4clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorInputs across region-branch ops

The ten CIR ops implementing RegionBranchOpInterface each hand-wrote
getSuccessorInputs, and all ten bodies were equivalent: regions take no
inputs, and returning to the parent yields the parent's results. Three did
not look equivalent but are: CleanupScopeOp and CoroBodyOp returned an empty
ValueRange unconditionally and declare no results, and AwaitOp returned
region block arguments but carries NoRegionArguments, so those ranges are
always empty.

Add a CIR_RegionBranchOpBase ODS class that declares the method and generates
the single shared body through extraClassDefinition, mirroring the existing
CIR_LoopOpBase, and retarget all ten ops onto it.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
ten definitions removed from CIRDialect.cpp.
DeltaFile
+0-57clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+28-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+28-772 files

LLVM/project 43a81eaclang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/unittests/CIR ControlFlowTest.cpp

[CIR] Add RegionBranchOpInterface unit tests and fix cir.await successors

Five of the ten ops implementing RegionBranchOpInterface have no unit test
coverage: cir.case, cir.cleanup.scope, cir.global, cir.await and
cir.coro.body. Add tests for all five.

Covering cir.await exposes a disagreement with its own terminator.
cir.condition terminates the ready region and reports {resume, suspend} as
its successors when the parent is an await, but AwaitOp::getSuccessorRegions
listed all three regions as entry successors and reported the parent op as
the successor of every region exit. Fix it to match cir.condition: ready is
the only entry successor, exiting ready branches to resume or suspend, and
exiting suspend or resume returns to the parent operation.

cir.await declares no results and carries NoRegionArguments, so successor
operand and input counts stay at zero along every edge and the MLIR verifier
is unaffected.
DeltaFile
+155-0clang/unittests/CIR/ControlFlowTest.cpp
+20-7clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+175-72 files

LLVM/project 484ce39flang-rt/lib/runtime CMakeLists.txt, flang/test/Lower/OpenMP omp-lib-integer-wrappers.f90

Revert "[OpenMP][Flang] Add integer-kind wrappers to omp_lib (#213505)" (#221003)

This reverts commit 01079d2605aabd0beccecb270f51d40119422f04.

And also follow-up PRs:
Revert "[flang-rt] Fix missing omp_lib symbols in static runtime archive
(#220821)"

This reverts commit 5ba0b37ca29e05939e5bdc77e756140821c23cce.

Revert "[flang-rt][OpenMP] fix buildbot failures after commit
01079d2605aabd0beccecb270f51d40119422f04 (#218611)"

This reverts commit 175afd988951626ee55de84a966cf1c66e103b59.
DeltaFile
+47-579openmp/module/omp_lib.F90.var
+0-465openmp/module/omp_lib_impl.F90.var
+0-237flang/test/Lower/OpenMP/omp-lib-integer-wrappers.f90
+2-37openmp/module/CMakeLists.txt
+0-29flang-rt/lib/runtime/CMakeLists.txt
+1-1openmp/runtime/cmake/LibompExports.cmake
+50-1,3482 files not shown
+51-1,3518 files

LLVM/project 1141d4fllvm/test/tools/llvm-exegesis/RISCV set-reg-init-check.s

[llvm-exegesis] Use %t.o instead of a literal %d in a RISC-V test (#220971)

The name therefore collides as soon as a second test in that directory
uses it. llvm-objdump mmaps the file while the concurrently running test
truncates and rewrites it, and touching a page past the new end of the
mapping kills llvm-objdump with SIGBUS, with no diagnostic.

Use %t.o, which lit expands to a name unique to the test, as every other
llvm-exegesis test already does.
DeltaFile
+2-2llvm/test/tools/llvm-exegesis/RISCV/set-reg-init-check.s
+2-21 files

LLVM/project 9410b2cllvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 combine-icmp.ll cmp-select-sign.ll

[X86] Prefer AVX512 VPCMP against zero over splat(1) for sle/slt (#216716)

InstCombine canonicalizes `icmp sle x, 0` to `icmp slt x, 1`. AVX512 `VPCMP`
can encode LE/GE against a zeroed register, but we were loading splat(1)
from the constant pool (`vpcmpltb .LCPI`).

### Approach
In `combineSetCC`, for AVX512 `vXi1` integer compares:
- Rewrite `slt x, splat(1)` / `sgt splat(1), x` to `sle x, 0`
- Rewrite `sgt x, splat(-1)` / `slt splat(-1), x` to `sge x, 0`
- Skip the existing LE/GE → LT/GT `incDecVectorConstant` fold when it
would
replace a zero splat with ±1 (avoids oscillating with the rewrite above)

This is the vector analog of scalar `TranslateX86CC` (`SETLT x, 1` →
`COND_LE`
vs 0). InstCombine is left unchanged.

Pre-AVX512 (`-mcpu=x86-64-v3`) still uses `vpcmpgtb` vs zero + `not`.

    [9 lines not shown]
DeltaFile
+179-0llvm/test/CodeGen/X86/avx512-icmp-sle-zero.ll
+27-27llvm/test/CodeGen/X86/vector-pcmp.ll
+31-0llvm/lib/Target/X86/X86ISelLowering.cpp
+12-12llvm/test/CodeGen/X86/avx512-broadcast-unfold.ll
+2-2llvm/test/CodeGen/X86/cmp-select-sign.ll
+2-1llvm/test/CodeGen/X86/combine-icmp.ll
+253-426 files

LLVM/project 5d41587libc/src/__support/File file.h, libc/src/__support/File/linux file.cpp

[libc] Make File::FileLock public in File data structure (#221005)

Commit 9db0037bf1b3 moved FileLock from namespace scope into class File
so internal methods could use RAII locking, but placed it in the private
section.

Move FileLock to the public section of class File so that external
callers operating on File streams can use RAII locking instead of manual
lock and unlock calls.

Port callers in puts, fgets, perror, fgetws, reopenfile, and the pwd
flat file database parser to use File::FileLock, and add a unit test
verifying RAII locking on File streams.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+13-13libc/src/__support/File/file.h
+2-15libc/src/stdio/generic/puts.cpp
+4-11libc/src/pwd/flat_file_db.h
+15-0libc/test/src/__support/File/file_test.cpp
+2-5libc/src/__support/File/linux/file.cpp
+1-2libc/src/wchar/fgetws.cpp
+37-462 files not shown
+39-508 files