clang/AMDGPU: Migrate cc1 tests to subarch triples (2)
Rewrite CodeGenCUDA cc1 test RUN lines from `-triple amdgcn... -target-cpu
gfxNNN` to the new subarch triple form, dropping the redundant -target-cpu.
Autogenerated CHECK lines are regenerated. Tests that intentionally assert
the "target-cpu" function attribute are left unchanged.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
clang/AMDGPU: Migrate cc1 tests to subarch triples (1)
Mechanically rewrite cc1 test RUN lines from the old
`-triple amdgcn... -target-cpu gfxNNN` form to the new subarch triple
form (e.g. `-triple amdgpu9.00-amd-amdhsa`), dropping the now-redundant
-target-cpu. The subarch encodes the exact target, so the emitted IR no
longer carries a "target-cpu" function attribute; autogenerated CHECK
lines are regenerated accordingly.
This batch covers the small CodeGen, Frontend, Layout, and Preprocessor
test directories.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[ConstraintElim] Precommit additional tests (NFC). (#211802)
Tests include
* shl nuw tests with known bounds.
* sadd.with.overflow.
* decompose failures due to precondiitons
* using info from latch condition
18278 rpc: pointers need more deadbeef
Reviewed by: Jason King <jason.brian.king+illumos at gmail.com>
Reviewed by: Andy Fiddaman <illumos at fiddaman.net>
Approved by: Gordon Ross <gordon.w.ross at gmail.com>
[AMDGPU] Fix incorrect grid_dims constant folding for reqd_work_group_size (#211285)
reqd_work_group_size(X, Y, 1) does not guarantee the dispatch runs with
work_dim == 2, since the spec still allows enqueuing with work_dim == 3
and a unit-size Z dimension. Only fold hidden_grid_dims to a constant
when Z != 1 (work_dim must be 3)
Otherwise tighten the range instead of assuming an exact value
Alterative approach to https://github.com/llvm/llvm-project/pull/205866
without killing constant folding
[OFFLOAD][L0] Properly consume errors in program validation (#211799)
Some of the program unittests were failing because errors weren't
consumed properly.
[libc++] Fix Python selection in the macOS benchmark jobs (#211812)
The macOS benchmark jobs install python 3.14 via Homebrew but added the
wrong prefix (<prefix>/libexec/bin) instead of <prefix>/bin to the PATH.
[lldb][test] Skip frame-recognizer argument tests on WebAssembly (#211807)
The recognizer reads arguments through $arg1/$arg2, which resolve via
argument registers. WebAssembly has no argument registers and no ABI
plugin, and these tests build without debug info, so there is no
location to read the arguments from and they come back as zero.
[lldb] Skip the WebAssembly function header for frame recognizers (#211806)
A frame recognizer restricted to the first instruction matches when the
frame's PC equals the function's start address. On WebAssembly a
function begins with a non-executable local variable header, so the
symbol's start address is never a value the PC can take and such
recognizers never matched.
Route the start address through Architecture::SkipFunctionHeader, which
already maps a function start past this header for breakpoints and
disassembly, so the comparison uses the first executable instruction.
[flang][OpenMP] Implement the error directive (#206175)
## [flang][OpenMP] Implement the `error` directive
### Summary
Implements the OpenMP `error` directive (OpenMP 5.1, 2.5.4) in Flang.
The directive prints a message and, with `severity(fatal)`, stops.
Handling depends on the `at` clause:
- **`at(compilation)`** (the default): handled in semantics. Emits a
compile-time warning or error and produces no IR.
- **`at(execution)`**: lowered to a new `omp.error` op, which becomes a
call to `__kmpc_error`.
Before this patch the directive was unimplemented and hit a `not yet
implemented: OmpErrorDirective` error during lowering.
Fixes #204240.
[55 lines not shown]
[X86] Truncate (v4i32 (vzext_movl (v2i64 bitcast (scalar_to_vector (i64 X))))) (#211798)
Noticed while triaging #211619 - truncate the i64 to i32 directly to avoid extra shuffles
[lldb] Speedup AppleObjCRuntimeV2 UpdateIfNeeded (#211774)
This converts a loop calling Process::ReadMemory into a single call to
Process::ReadMemoryRanges.
[LifetimeSafety] Support container interior paths and invalidations
This patch completes the implementation of path-sensitive lifetime tracking by supporting container interior paths (`.*`) and deep-nested invalidation.
- Enables `PathElement::getInterior` generation in `FactsGenerator` for GSL Owners and Views (e.g. member functions, function parameters, lambda captures).
- Removes bypass checks in `FactsGenerator::handleInvalidatingCall` to track container invalidation on fields.
- Updates `Checker` to use strict prefix comparison (`isStrictPrefixOf`) for container invalidations, ensuring invalidation of container contents (interior) correctly invalidates iterators but not other sibling fields.
- Reorganizes tests in `invalidations.cpp` by resolving duplicates and distributing them logically.
- Updates unit tests and sema tests with correct expectations for interior paths.
TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
[SystemZ][z/OS] Add the OF_Text flag to read .ll files and parse assembly files (#211782)
This patch allows us to parse .ll files in verify-uselistorder correctly
and fixes failures in any testcase that uses this tool.
[LifetimeSafety] Support field-sensitivity in lifetime tracking
This patch enables field-sensitivity when tracking lifetimes of nested objects.
- FactsGenerator now generates `PathElement::getField` for `MemberExpr` accesses, mapping fields to loans.
- LoanPropagation now propagates field paths along flow facts, appending fields to base loans.
- Removes false-positive warnings in `invalidations.cpp` where modifications to one field were incorrectly reported as invalidating iterators/pointers to another field.
- Adds comprehensive unit tests checking nested field access and placeholder fields.
TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
[LifetimeSafety][NFC] Update Checker to use prefix comparison interfaces
This patch switches the Checker's expiry and invalidation checks to use `AccessPath::isPrefixOf` instead of equality (`==`).
Since all generated access paths are currently empty, `isPrefixOf` is behaviorally identical to `==` (NFC). This prepares the checker to handle nested paths (fields and container interiors) in subsequent commits.
TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
[LifetimeSafety][NFC] Refactor AccessPath and Loan representations
This patch refactors the internal representations of `AccessPath` and `Loan` to support path elements, preparing for field-sensitive and interior-sensitive lifetime tracking.
- Introduces `PathElement` representing a field or interior dereference.
- Refactors `AccessPath` to contain a base and a list of `PathElement`s.
- Updates `Loan` and `LoanManager` to use the new `AccessPath` structure.
- Refactors debug dump formatting to output path elements if present.
- Updates Checker and FactsGenerator to compile with the new interfaces, keeping logic behaviorally identical (NFC).
TAG=agy
CONV=2cfd8d00-18d7-4a03-8d78-2aba2f9a8f23
[CodeGen] PHIEliminationImpl::LowerPHINode: Fix assertion failure when all phi operands are undefined (#209013)
IncomingReg is only set to a register when allPhiOperandsUndefined does
not hold. Changes PHIEliminationImpl::LowerPHINode to check IncomingReg
before using it for debug phi.
Fixes #206324
Assisted-by: Codex
Add !metadata_section_kind global variable metadata (#211524)
Similar to !exclude in that this attempts to guide section + flag
choices in a generic/abstract way.
`!exclude` tells LLVM to use the generic `SectionKind::Exclude` for the
globals. Likewise, `!metadata_section_kind` tells LLVM to use
`SectionKind::Metadata`.
The added docs go into a little more detail.
This is needed for the dynamic debugging feature, otherwise there's no
way to avoid `SHF_EXCLUDE` or `SHF_ALLOC` flags being added to the
section without special handling based on its name. We've moved to using
a new section type for dynamic debugging and we don't want to rely on
the name, which may be omitted.
[ConstantFolding]Fold llvm.powi via square-and-multiply (#210771)
Compute constant-folded powi using APFloat multiplies in the operand's
own semantics (square-and-multiply), matching the expansion
ExpandPowI generates in SelectionDAGBuilder, instead of routing
through std::pow via double/float conversion.
Import Crypt::URandom::Token-0.005 as p5-Crypt-URandom-Token.
This module provides a secure way to generate a random token for passwords
and similar using Crypt::URandom as the source of random bits.
By default, it generates a 44 character alphanumeric token with more than
256 bits of entropy. A custom alphabet with between 2 and 256 elements can
be provided.
Modulo reduction and rejection sampling is used to prevent modulus bias. Keep
in mind that bias will be introduced if duplicate elements are provided in
the alphabet.