[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]
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[CIR] Migrate seven operation enums off IntegerAttr (#220883)
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.
[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
[16 lines not shown]
[Clang] Clean up leftover old offloading driver tools and utilities (#221093)
Summary:
This PR cleans up some now unused utilities.
1. The old driver fatbinary object building
2. The SDL library linking
3. The offload bundler unbundler job
These are all replaced by operations the new driver does. The one hitch
is that the `--offload-device-only -lfoo -frdc` will not unbundle like
it once did, but I am unsure if that was ever used much in practice.
[clang-tidy] Fix renaming parameter packs in `sizeof...` expressions (#219155)
Record parameter pack usages held by `SizeOfPackExpr` in the common
renamer visitor. This ensures that declarations and `sizeof...`
references are renamed together.
Closes #219154
[clang-tidy][NFC] Test all bugprone-exception-escape option modes (#221164)
AI Usage: GPT 5.6 Sol was used to help with pre-commit self-reviewing.
Follow-up of https://github.com/llvm/llvm-project/pull/218067.
[TTI/RISCV] Strip getMaxVScale (#220547)
RISC-V is the only target using it at the moment, and it is unnecessary,
as frontends insert a vscale_range attribute that we can use. As such,
this patch is a non-functional cleanup, along with test updates, taking
care to minimize the diff by inserting the vscale_range attribute in
various tests.
[CIR] Fix cir.cleanup.scope successor regions
CleanupScopeOp::getSuccessorRegions reported both the body and the cleanup
region as successors of the parent operation, and the parent operation as the
successor of every region exit. That claims the cleanup region can be entered
without running the body, and it drops the body-to-cleanup edge entirely,
contradicting the comment that sat right above it.
Report the chain the operation actually executes: the body region is entered
from the operation, an exit from the body that triggers the cleanup runs the
cleanup region, and exiting the cleanup region leaves the operation.
Which body exits trigger the cleanup depends on both the terminator and the
cleanup kind. cir.resume leaves the body while unwinding, so it runs the
cleanup exactly 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, which is the case FlattenCFG handles in
collectResumeOps under the same condition. Unwinding from an arbitrary point
[17 lines not shown]
[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.
[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.