LLVM/project 9853cb5libcxx/include/__algorithm pstl.h, libcxx/include/__pstl/cpu_algos min_element.h

[libc++][pstl] Implementation of parallel std::min_element() based on parallel reduce (#219876)

This PR adds an implementation of parallel `std::min_element()` based on
parallel reduce.
`std::max_element()` is also added, implemented as a "one-liner" over
`min_element`.

The implementation formulates `min_element` as a reduction of iterators
over the input range.
The reduction is provided in two forms: 2-element reduction that picks
the iterator pointing to a smaller value, and a range-based reduction
with init value. The latter delegates the heavy-lifting to the serial
implementation of `std::min_element()`.

Part of #99938.
DeltaFile
+149-0libcxx/test/std/algorithms/alg.sorting/alg.min.max/pstl.max_element_comp.pass.cpp
+149-0libcxx/test/std/algorithms/alg.sorting/alg.min.max/pstl.min_element_comp.pass.cpp
+146-0libcxx/test/std/algorithms/alg.sorting/alg.min.max/pstl.max_element.pass.cpp
+146-0libcxx/test/std/algorithms/alg.sorting/alg.min.max/pstl.min_element.pass.cpp
+88-0libcxx/include/__pstl/cpu_algos/min_element.h
+50-0libcxx/include/__algorithm/pstl.h
+728-010 files not shown
+823-016 files

LLVM/project 71d8985llvm/lib/XRay InstrumentationMap.cpp, llvm/test/tools/llvm-xray/SystemZ extract-instrmap.test

[XRay] Enable XRay for SystemZ (#213577)

Fixes InstrumentationMap parsing for big-endian targets and adds SystemZ
support.
DeltaFile
+253-0llvm/test/tools/llvm-xray/SystemZ/Inputs/elf64-pic.yaml
+27-0llvm/test/tools/llvm-xray/SystemZ/extract-instrmap.test
+4-2llvm/lib/XRay/InstrumentationMap.cpp
+284-23 files

LLVM/project 63aa7d5llvm/test/Transforms/SLPVectorizer/AArch64 splat-gather-subtree-store-chain.ll

[SLP][NFC]Add a test with missed vectorization due to tree size inflate for splats, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/221237
DeltaFile
+63-0llvm/test/Transforms/SLPVectorizer/AArch64/splat-gather-subtree-store-chain.ll
+63-01 files

LLVM/project 4c986c2clang/include/clang/CodeGenUtils CodeGenUtils.h, clang/lib/CIR/CodeGen CIRGenModule.cpp

[NFCI] Extract out some functions into CodeGenUtils. (#221001)

I need to use these for CIR (see #220946). Also, its been a long-time
coming that we had a way to share stuff between both CodeGens.

This patch does (hopefully) the infrastructure work to get this running
right.

I asked Claude to help me with the CMake files, and best I can tell it
looks right? But if someone knows better, please let me know. I suspect
we might need to add dependencies along the way as we add new things,
but this seems to work at the moment?

Otherwise, this just moves a handful of trivial utilities that seemed
like a good starting point, plus one I need for CIR right away.
DeltaFile
+115-0clang/lib/CodeGenUtils/CodeGenUtils.cpp
+5-90clang/lib/CodeGen/CGClass.cpp
+42-0clang/include/clang/CodeGenUtils/CodeGenUtils.h
+2-21clang/lib/CodeGen/CodeGenModule.cpp
+2-19clang/lib/CIR/CodeGen/CIRGenModule.cpp
+6-9clang/lib/CodeGen/CGExpr.cpp
+172-1398 files not shown
+198-16714 files

LLVM/project 4698bcbclang/include/clang/Analysis/FlowSensitive DataflowValues.h, clang/include/clang/StaticAnalyzer/Core/PathSensitive SummaryManager.h

[clang] Remove dead headers (NFC) (#221161)

None of these headers are referenced anywhere in the repository.
DeltaFile
+0-172clang/include/clang/Analysis/FlowSensitive/DataflowValues.h
+0-57clang/include/clang/StaticAnalyzer/Core/PathSensitive/SummaryManager.h
+0-2292 files

LLVM/project 4a35c88clang/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 f2d02f2clang/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 d9dba30clang/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 1ca097aclang/include/clang/CIR/Dialect/IR CIRTypes.td CIRCUDAAttrs.td, clang/test/CIR/IR invalid-lang-attr.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-lang-attr.cir
+73-1431 files not shown
+74-1447 files

LLVM/project b1abeeeclang/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 5cf2ec6clang/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
+20-0clang/test/CIR/IR/enum-attrs.cir
+12-2clang/include/clang/CIR/Dialect/IR/CIROps.td
+1-1clang/test/CIR/CodeGenBuiltins/builtin-isinf-sign.c
+69-395 files

LLVM/project f216b35clang/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
+28-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
+49-83 files

LLVM/project faf1b68clang/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
+26-0clang/test/CIR/IR/enum-attrs.cir
+19-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+45-62 files

LLVM/project 61c0612clang/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
+28-0clang/test/CIR/IR/enum-attrs.cir
+66-302 files

LLVM/project 3d79322clang/lib/CIR/Dialect/Transforms FlattenCFG.cpp

[CIR][NFC] Use CleanupKindAttr predicates in FlattenCFG

FlattenCFG spelled the cleanup-kind tests three ways: raw enum comparisons
against Normal and All in flattenCleanup, and `!= CleanupKind::Normal` twice in
the match method. CleanupKindAttr already declares isNormal() and isEH() with
exactly those meanings, and the loop path already reads the attribute rather
than the enum, so use the predicates throughout.

CleanupScopeOp::getSuccessorRegions depends on this same invariant. Stating it
in one place means a later change to the kinds cannot leave the copies
disagreeing.
DeltaFile
+8-10clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
+8-101 files

LLVM/project 019bc28clang/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 ee5d07bclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorInputs across region-branch ops (#220509)

All ten CIR ops implementing `RegionBranchOpInterface` hand-wrote
`getSuccessorInputs`, and all ten implementations expressed the same
behavior: regions take no inputs, while returning to the parent yields
the parent’s results.

Three appeared different but were equivalent: 
- `CleanupScopeOp` and `CoroBodyOp` unconditionally returned an empty
ValueRange, and neither declares results in ODS.
- `AwaitOp` returned region block arguments, but it carries
`NoRegionArguments`, so those ranges are always empty.

`CIR_RegionBranchOpBase` now declares the method and generates the
shared implementation through extraClassDefinition.
DeltaFile
+0-57clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+28-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+28-772 files

LLVM/project d7dc5d2clang/lib/CIR/Dialect/Transforms FlattenCFG.cpp

[CIR][NFC] Use CleanupKindAttr predicates in FlattenCFG

FlattenCFG spelled the cleanup-kind tests three ways: raw enum comparisons
against Normal and All in flattenCleanup, and `!= CleanupKind::Normal` twice in
the match method. CleanupKindAttr already declares isNormal() and isEH() with
exactly those meanings, and the loop path already reads the attribute rather
than the enum, so use the predicates throughout.

CleanupScopeOp::getSuccessorRegions depends on this same invariant. Stating it
in one place means a later change to the kinds cannot leave the copies
disagreeing.
DeltaFile
+8-10clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp
+8-101 files

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

[CIR] Fix cir.cleanup.scope successor regions

CleanupScopeOp::getSuccessorRegions listed both the body and the cleanup
region as successors of the parent op, and the parent op as the successor of
every region exit. That says the cleanup region can run without the body, and
it drops the body-to-cleanup edge, contradicting the comment directly above it.

Report the chain the op really executes. The parent enters the body, a body
exit that triggers the cleanup enters the cleanup region, and the cleanup
region exits to the parent.

Which body exits trigger the cleanup depends on the terminator as well as the
cleanup kind. cir.resume leaves the body while unwinding, so it runs the
cleanup when the kind is EH-capable. cir.yield and cir.co_return are normal
exits and run it when the kind covers normal exits. A cir.resume can terminate
a block of an unflattened cleanup-scope body once an inner cleanup scope has
been flattened, the same case FlattenCFG handles in collectResumeOps.

RegionBranchOpInterface can only describe an unwind that leaves from a

    [23 lines not shown]
DeltaFile
+200-29clang/unittests/CIR/ControlFlowTest.cpp
+23-5clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+4-5clang/include/clang/CIR/Dialect/IR/CIROps.td
+227-393 files

LLVM/project 087826dflang/lib/Semantics resolve-directives.cpp, flang/test/Semantics/OpenMP default-none02.f90 default-none.f90

[flang][OpenMP] Do not emit an error for CRITICAL inside DEFAULT(NONE) (#216403)

Fixes #197394
Fixes #197396

Assisted-By: Claude Sonnet 5
DeltaFile
+56-4flang/lib/Semantics/resolve-directives.cpp
+45-0flang/test/Semantics/OpenMP/default-none.f90
+23-0flang/test/Semantics/OpenMP/default-none02.f90
+124-43 files

LLVM/project 6905604lldb/test/API/symstore TestSymStore.py

[lldb][test] Fix flaky results from TestSymStore.py test_http_timeout (#221196)

Fixes #217733.

Observed only on Windows on Arm but I bet it can happen other places.
Sometimes the test would fail because it did not find the error message
in the log file.

The problem is that the test is relying on the client to realise the
timeout has been exceeded and close the connection, before the fake
responder can send back status 200.

So what sometimes happens is:
* The client sends the request.
* The server gets the request and waits N seconds.
* The client is delayed doing other things, and doesn't realise the
timeout has been reached. So the connection is still open.
* The server tries to respond with 200, and that sends succesfully.
* The client wakes up and sees the 200 response, so there's no error to

    [19 lines not shown]
DeltaFile
+20-20lldb/test/API/symstore/TestSymStore.py
+20-201 files

LLVM/project 777332bclang/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 d0259a5clang/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 25a5b78clang/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 4216b91clang/include/clang/CIR/Dialect/IR CIRTypes.td CIRCUDAAttrs.td, clang/test/CIR/IR invalid-lang-attr.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-lang-attr.cir
+73-1431 files not shown
+74-1447 files

LLVM/project 3fdea5bclang/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 948ff23clang/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
+28-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
+49-83 files

LLVM/project 5f5f338clang/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
+20-0clang/test/CIR/IR/enum-attrs.cir
+12-2clang/include/clang/CIR/Dialect/IR/CIROps.td
+1-1clang/test/CIR/CodeGenBuiltins/builtin-isinf-sign.c
+69-395 files

LLVM/project 66a23ceclang/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
+28-0clang/test/CIR/IR/enum-attrs.cir
+66-302 files

LLVM/project 80c871eclang/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
+26-0clang/test/CIR/IR/enum-attrs.cir
+19-6clang/include/clang/CIR/Dialect/IR/CIROps.td
+45-62 files