[clang][test][AIX] Set OBJECT_MODE=any for all clang test (#209531)
This patch sets OBJECT_MODE=any to have tools able to handle 32-bit or
64-bit objects.
Turn signal handling on in LineEditor (#203616)
This PR was created to address
https://github.com/jank-lang/jank/issues/801.
Without signal handling, `CLRL+C` / `CTRL+Z` leaves the terminal in an
awkward state, breaking other command line tasks and forcing the user to
open a new/clean terminal window.
cc: @jeaye
### Edit
#### AI
Per the contribution policies and review practices, AI was used to
locate the root cause of the issue I was seeing. From there, I
personally wrote the code and manually tested the build to verify that
the change fixed the problem I was seeing.
[6 lines not shown]
[lldb][Windows] Use extended path prefix for rmtree (#209409)
The test suite previously only warned when a test build directory or
artifact path exceeded Windows' `MAX_PATH (260)` limit, and
`shutil.rmtree` could fail to clean up such directories. This replaces
the warnings with actual long-path support.
This is a recurring problem in Swiftlang.
[flang] Derive target-specific data layout from triple in TargetRewrite (#209649)
When target-rewrite runs without an explicit llvm.data_layout attribute,
it falls back to hardcoded generic default in MLIR (kDefaultDataLayout)
which specifies f128 ABI alignment as 16 bytes. This is incorrect for
targets where f128 ABI alignment differs from its size, such as SystemZ
which requires 8 bytes per the ELF ABI.
The target triple is available in the target-rewrite pass. Fix by
deriving the data layout from the target triple using
triple.computeDataLayout() before falling back to the generic default,
ensuring target-specific alignments are correctly reflected in
dlti.dl_spec.
@uweigand @dominik-steenken
---------
Co-authored-by: anoop.kumar6 at ibm.com <anoopk at b35lp63.lnxne.boe>
[Polly] Fix codegen assertions to account for DefinedBehaviorContext (#209188)
DeLICM may produce new read access relations whose domain is restricted
to the DefinedBehaviorContext (e.g., only valid when a parameter ensures
no UB). The validation in setNewAccessRelation already accounts for
this, but the debug assertions in createNewAccesses and
generateScalarLoads did not, causing false assertion failures during
code generation.
Intersect the checked domains with getBestKnownDefinedBehaviorContext()
to match the contract that DeLICM relies on.
Fixes #205732
Create a Template member to be the MemberSpec of a failed TemplVarDecl (#209604)
Patch #200092 changed to no longer check the previous var template when
setting whether the current one is a member specialization. However, if
the previous one was actually an error case (see the example here and in
the report), we ended up trying to do that anyway, which caused an
assertion.
This patch puts in a 'fake' declaration for the not-found declaration after we
emit the 'not found' error for the purposes of allowing our diagnostics to
continue evaluating these without causing problems.
Fixes: #209432
(cherry picked from commit 2c2e43675910603bab1b163655786e4850569d74)
[mlir][SCFToAffine] Raise scf.for to affine.for (#200851)
Add a pass `-raise-scf-to-affine` that rewrites `scf.for` into
`affine.for` when the bounds and step are valid affine quantities. It
handles constant and dynamic steps, and integer-typed loops (by a
lossless cast of the bounds to `index`).
This is a first step; raising further scf ops to affine will follow.
Assisted-by: Claude Code (Anthropic)
Co-authored-by: Ming Yan <nexming7 at gmail.com>
Co-authored-by: Julian Farnsteiner <jcf96 at proton.me>
[VPlan] Fix nowrap flags for strided access pointers from SCEV (#209453)
This patch addresses two things. First, the offset calculation
(canonical IV * stride) should not reuse the NSW flag of the add
recurrence. The NSW property from SCEV for the original scalar
recurrence does not necessarily hold for the reconstructed
multiplication using the vector canonical IV. The NUW flag, however, can
still be safely propagated.
Second, because vputils::getGEPFlagsForPtr currently doesn't support
recipes other than VPInstruction, and to avoid relying on LLVM IR
function (like calling stripPointerCasts()), we change
VPVectorPointerRecipe's GEP flags to use the add recurrence's flags to
prevent propagating unprovable GEP flags like inbounds.
(cherry picked from commit 1d4148821bf96bef23ea77952031e3e7bec26d3a)
[AArch64] Remove HCX feature flag from backend (#209477)
This patch removes +hcx option from the llvm and removes guarding of
HCRX_EL2 system register on it.
(cherry picked from commit f48200029bf6277d4fe3915b480a5c87c8f172c9)
[X86] Skip debug instructions in tile copy lowering (#209640)
X86LowerTileCopy iterates over instructions in reverse to track live
registers, calling LiveRegUnits::stepBackward on every instruction
unconditionally. Since commit 16b2ef32 added an assertion that
stepBackward must not receive debug instructions, functions containing
debug info hit the assertion during tile copy lowering.
This patch skips debug instructions early in the loop, matching the
guard pattern used in RegisterScavenging.cpp and X86FixupBWInsts.cpp.
Fixes #209512
(cherry picked from commit 3e4160fdc3d5bb0ed86480604bdfcd3130e7dd37)
[Clang] Require x86 target for some tests (#209532)
These tests assert behavior about the always-inliner which now requires
a target to be present to check function attribute compatibility for
inlining.
Fix forward for 37b8e765ce4837a7577e6f762bcdffe4b232759c.
(cherry picked from commit 97f76580cdb0893d0b4edc7adf703162a23c0a67)
AMDGPU: Use module flags to control xnack and sramecc
This ensures these ABI details are encoded in the IR module
rather than depending on external state from command-line flags.
Previously, these were encoded as function-level subtarget features.
The code object output was a single target ID directive implied
by the global subtarget. The backend would previously check if a
function's subtarget feature mismatched the global subtarget. This
is avoided by making xnack and sramecc module-level properties from
the start. This also provides proper linker compatibility
enforcement, moving the error point earlier.
The old encoding was also an abuse of the subtarget feature system.
Subtarget features are a bitvector, and later features in the string
can override earlier ones. The old handling added a special case
where explicit settings were preserved: ordinarily +feature,-feature
should result in the feature being disabled, but +xnack,-xnack would
preserve the explicit "-xnack" state, which differs from the absence
of any xnack setting.
[25 lines not shown]
[clang][SSAF] Optionally skip system-header contributors (#205446)
A new —ssaf-no-extract-from-system-headers switch that gates the
contributor finder so contributors located inside system headers are
dropped from the per-TU summary.
rdar://179151040
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
AMDGPU: Migrate MIR parser tests to new subarch triples (59)
Mechanical migration by script.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
AMDGPU: Migrate more tests to using subarch triple commands (57)
Mostly mechanical updates with some light cleanups manually
applied.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
AMDGPU: Migrate uniform target-cpu attribute tests to subarch triple (55)
For tests that set the subtarget via a single uniform "target-cpu" IR function attribute, fold the cpu into the amdgpu subarch triple on the RUN lines, drop the redundant -mcpu, and remove the "target-cpu" attribute (deleting now-empty attribute groups and their references). The subtarget is unchanged, so codegen output is preserved.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Migrate tests with regenerated checks to amdgpu subarch triple (54)
Fold the explicit -mcpu subtarget into the amdgpu subarch triple on autogenerated tests where the folded triple changes output relative to the previous default subtarget (e.g. cost-model BASE lines, scheduling). CHECK lines were regenerated with the update_*_test_checks.py scripts.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
clang: Use TargetID parsing from AMDGPUTargetParser
We had grown 2 parallel parsing implementations for
triple+gpu name+feature flag target ID strings. Mostly
eliminate the redundant clang version.
Co-authored-by: Claude (Opus 4.8)
AMDGPU: Add TargetID::printCanonicalTargetIDString
Factor the canonical feature-string formatting into a raw_ostream print
method so callers can stream directly without a temporary std::string.
getCanonicalFeatureString now delegates to it.
AMDGPU: Remove now-unused splitTargetID
splitTargetID was a syntactic-only target-ID splitter used solely by
clang's getConflictTargetIDCombination, which now parses through the
canonical llvm::AMDGPU::TargetID::parse instead. With that last user
gone, drop the function, its declaration, and its unit test.