[SLP] Fix spill-cost cache lookup and predecessor scan
A cached intra-block scan that stopped at a call or budget limit only
proves the sub-range below the stop point is call-free; do not reuse
the cached bit for queries whose First lies above it. Also switch the
cross-block predecessor scan to "exists a call-free backward path"
semantics, skip blocks strictly dominated by Root, and memoize only
the (Root, OpParent) key. Fixes a false-positive spill cost that was
blocking profitable vectorization.
Reviewers: RKSimon, hiraditya, bababuck
Pull Request: https://github.com/llvm/llvm-project/pull/192709
[NVPTX] Scalarize `contract FMUL v2f32` to enable FMA fusion (#192815)
SM100+ legalizes `FMUL v2f32`, blocking the scalar FADD->FMA combiner.
Scalarize it when `contract` (or `allowFMA()`) is set and every lane
feeds a single `contract` FADD.
[clang][bytecode] Add new IntegralType for function addresses (#194206)
We used to use just `::Address` for functions, which later caused
problems because we casted the pointer to `ValueDecl*` and passed it to
`Program::getOrCreateGlobal()`, which doesn't work of course.
[clang][bytecode] Fix some problems with ptr-to-int casts (#193988)
1) When doing integral casts on a pointer-casted-to-integral, check the
bitwidth we're casting _to_, not the one we're casting _from_.
2) When the pointer we're casting to an integral is a dummy pointer,
don't forget to check the bitwidth.
[MC] Add MCTargetOptions to MCAsmInfo constructor. NFC (#194200)
Since #180464 the canonical MCTargetOptions pointer is stored in
MCAsmInfo, but it is bound after construction via `setTargetOptions`
called from TargetRegistry::createMCAsmInfo.
Direct constructions in unit tests can leave the pointer null, leading
to a runtime assert failure. Add MCTargetOptions to every MCAsmInfo
subclass constructor, store it as a reference in MCAsmInfo, and remove
`setTargetOptions()`.
[libcxx] Include python3-yaml and rsync in container (#194182)
rsync is needed for installing the kernel headers for the libc build.
The yaml python package is needed for libc's hdrgen. This means we no
longer have to install these utilities at runtime.
They should be small enough relative to the existing container image
size to not really have an impact in that regard.
[mlir][arith] Fold subi(a, subi(a, b)) to b (#194134)
Add a folder for `arith.subi` that simplifies `subi(a, subi(a, b))` to
`b` using the algebraic identity `a - (a - b) = b`.
[MLIR][XeGPU] Remove offsets from create_nd_tdesc & remove update_nd_offset, move offsets to load/store/prefetch ops (#193330)
This PR removes the optional offsets/const_offsets operands on
xegpu.create_nd_tdesc and instead mandates offsets directly on the
consuming load, store, and prefetch ops. It also deprecates the
update_nd_offset op.
[libclc] Only check the triple architecture for libclc (#194149)
Summary:
Previously, `nvptx64--` would reject `nvptx64-unknown-unknown`. Two
options, either normalize all the triples in CMake, or just check the
architecture. I went with the former because it makes it easier for
people to pass different values.
[compiler-rt] Use asm .set only for Hexagon (#194160)
Two incompatible assembler syntaxes exist for symbol assignment:
```
sym = val -- accepted by most GNU assembler targets; rejected by
Hexagon, which interprets it as a mnemonic
.set sym, val -- accepted by Hexagon; rejected by Alpha, which
reserves .set for assembler mode flags
```
Switch all to `sym = val`, and opt out Hexagon to `.set sym`.
Fixes: dbb03f8f606e ("[compiler-rt] Replace assignment w/.set directive
(#107667)")
---------
Co-authored-by: Vitaly Buka <vitalybuka at google.com>
[MC] Drop MCTargetOptions parameter from MCTargetAsmParser (#194120)
Since #180464, MCAsmInfo holds the canonical MCTargetOptions.
The MCTargetAsmParser::MCOptions member is a redundant by-value copy,
which may have inconsistent values (llvm-exegesis passes a temporary
MCTargetOptions(), but this probably doesn't matter in practice; other
in-tree uses are correct).
Remove the field in favor of getParser().getContext().getTargetOptions,
and remove the MCTargetOptions parameter from the base ctor, all
subclass ctors, Target::createMCAsmParser, MCAsmParserCtorTy, and
RegisterMCAsmParser.
[MC] Always lower .fill to MCFillFragment (#194164)
Constant-count, constant-pattern .fill expands inline into the current
fragment via emitIntValue per byte, wasting both memory and time (a
redundant copy at MCAssembler.cpp). #50974 reports a 4s compile dropping
to 0.6s when the loop is removed.
Drop the inline path so .fill always becomes MCFillFragment.
This cannot be done before commit 507efbcce03d (2023) allowed
label differences to be separated by a MCFillFragment.
In directive_fill.s, the parse time warning is now diagnosed by
MCAssembler.
Reland "[libc][math] Refactor fmaximum_mag_num family to header-only" (#194194)
Reland #182169
---------
Co-authored-by: Muhammad Bassiouni <60100307+bassiounix at users.noreply.github.com>
[BOLT] Add tests for pre-aggregated parsing (#193843)
Extends e2e coverage of pre-aggregated profile parsing to match the
unit-test coverage added in #192390:
- R (Return) records, including the branch=0 fallback path that
rewrites to the FT_EXTERNAL_RETURN sentinel.
- r (FT_EXTERNAL_RETURN) records.
- B and T records using the negative -1 hex form (#192391),
which is parsed as the BR_ONLY/FT_ONLY sentinel.
- Error paths: invalid record type letter and malformed hex address
(perf2bolt is expected to exit non-zero with a parser error).
The two error-path inputs are tiny raw files under Inputs/ since they
contain intentionally malformed records that link_fdata doesn't process.
Test Plan:
added bolt/test/X86/pre-aggregated-records.s
[libc][math] Qualify fdim funtions to constexpr (#194137)
Signed-off-by: udaykiriti <udaykiriti624 at gmail.com>
Co-authored-by: Muhammad Bassiouni <60100307+bassiounix at users.noreply.github.com>
[lldb][test] Use assertIn in TestThreadBacktraceRepeat.py (NFC) (#194193)
I broke this test locally, and fixed the assets to produce more useful
output upon failure.
[BOLT] Support negative hex in pre-aggregated profile (#192391)
Handle signed values in parseHexField by falling back to int64_t parsing
when uint64_t fails. This allows pre-aggregated profile tools to use -1
for BR_ONLY, -2 for FT_EXTERNAL_ORIGIN, -3 for FT_EXTERNAL_RETURN.
Guard the external address reset loop in parseAggregatedLBREntry to
preserve sentinel values (offsets >= FT_EXTERNAL_RETURN).
Add tests for -1/-2/-3 in parseHexField and T entries with -1,
ffffffffffffffff, and buildid:-1 as BR_ONLY.