[MISched](NFC) Factor control dependency construction state and logic out of `buildSchedGraph` (#226533)
Continuing the groundwork for a proper implementation of #205689, factor
the control dependency construction state and logic out of
`ScheduleDAGInstrs` into a friend class. This will also enable us to
further break up `buildSchedGraph` to make, e.g., the barrier chain
handling easier to comprehend.
[ADT] Move DenseMapIterator above DenseMapBase (NFC) (#227208)
This patch moves the definition of DenseMapIterator right above
DenseMapBase so that all classes in DenseMap.h are defined in the
bottom-up order without forward declarations:
- DenseMapStorage
- SmallDenseMapStorage
- DenseMapIterator
- DenseMapBase
- DenseMap
- SmallDenseMap
Assisted-by: Antigravity
[GitHub] Fix test-suite.yml FFmpeg build with AArch64 (#227346)
On AArch64 there are assembly files that need CMAKE_ASM_COMPILER_TARGET
and CMAKE_ASM_FLAGS_INIT set
[AMDGPU] Don't apply gfx950 fetch-window loop align to the wrong block (#221821)
MachineBlockPlacement aligns the backedge destination after loop
rotation, which may not be the LoopInfo header. Query that block for the
32-byte request and the 4-byte pad cap so they stay consistent.
## Summary
- Pass the block being aligned into `getPrefLoopAlignment` so gfx950
fetch-window alignment uses the backedge destination, not only the
LoopInfo header.
- Unrotated 8-byte headers still get capped.
- Rotated 4-byte landing pads are no longer given uncapped 32-byte
alignment.
[mlir][arith] Support equal-width float conversions (#225346)
Use arith.convertf in convertScalarToDtype when converting between
floating-point types that have the same bit width but different
semantics.
Add focused unit coverage for f16-to-bf16 and bf16-to-f16 conversions.
Assisted-by: Codex
[compiler-rt] Remove dlsym interceptor for HSA UBSan (#227022)
Summary:
This existed to handle the OpenMP case that dynamically opened via
`dlsym`. However, https://github.com/llvm/llvm-project/pull/227020
removes the need for this by first checking the global space first.
The main motivation is that the `dlsym` interceptor layer was the most
janky part of this whole affair and was a major blocker to supporting
`-shared-libsan` in https://github.com/llvm/llvm-project/pull/226551.
[libc++] Add coverage for push_range on stack/queue with non-default underlying containers (#210730)
This increases the test coverage for stack/queue and actually caught an
issue in list::__invariants which was previously dead code.
[lldb][AArch64][Linux] Add llvm_unreachable after some RegisterSetType switches (#223375)
The ones where you are supposed to case X: return Y;. We do enable the
not fully covered switch warning, so the unreachable just makes the
mistake more obvious.
I did not change GetInvalidationMask because this will be refactored by
#223373.
[llvm] Upgrade ARM data layouts that are missing Fi8 (#224639)
Such as the ones in
https://github.com/llvm/llvm-test-suite/tree/main/Bitcode/simd_ops,
which started failing to compile after
https://github.com/llvm/llvm-project/pull/224012
stopped us overriding the module data layout.
fatal error: error in backend: Can't create a MachineFunction using a
Module with a Target-incompatible DataLayout attached
Target DataLayout: e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64
Module DataLayout: e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64
The old layout is p32:32-i64, the new is p32:32-Fi8-i64.
In this change I have added this case to the data layout upgrades. If
there's no p32:32, the layout is not changed, also if there is already a
"Fi" or "Fn" in the layout. These cases may not exist or be valid in
reality, but I need some fallback behaviour just in case.
[SystemZ][z/OS] Use a function descriptor for external functions in initializers (#226682)
The address of an external function in a static initializer was emitted
as a V-con, i.e. the entry point, while an XPLINK function pointer must
point to a function descriptor. A call through such a pointer loads the
environment and entry point from the machine code of the function.
Create a descriptor in the ADA for external functions as well, as is
already done for internal functions and for constructor/destructor lists
(`emitXXStructorList`).
`zos-lower-constant.ll` is updated: the pointer to the external function
`bar` now points to its descriptor in the ADA.
A minimal program (`int (*p)(void) = ext;` called from `main`) ended
with S0C6 at address `0707070707070707` on z/OS 3.1; with this change it
returns the expected value.
Tests: `llvm-lit test/CodeGen/SystemZ test/MC/SystemZ test/MC/GOFF`
passes (1303 passed, 19 unsupported).
[5 lines not shown]
[X86] LowerStore - peek through oneuse bitcasts to see if vector is freely splittable. (#227282)
Peek through bitcasts when seeing if we can avoid an unnecessary
concat_vectors and store the subvectors directly - if the concat had
been worth it, combineConcatVectorOps would have moved the concat
further up.
Helps avoid more cases of unnecessary vzeroupper, 256-bit usage etc. in
particular on AVX1 targets (Sandybridge, Jaguar and Bulldozer all
benefit from this), but AVX2/512 targets as well.
[RISCV][P-ext] Add packed multiply high parts accumulate intrinsics (#224261)
Add intrinsics, Clang builtins and SelectionDAG support for the RISC-V P
multiply high accumulate with byte/halfword index operations.
See
https://github.com/riscv/riscv-p-spec/blob/master/P-ext-intrinsics.adoc#packed-multiply-high-parts-accumulate.
The pmhacc.h.bXX forms operate on the whole register and select directly
on both RV32 and RV64.
The pmhacc.w.hXX forms select directly on RV64, on RV32 there is no
64-bit packed form, so the intrinsics split into a pair of scalar
mhacc.h0/mhacc.h1 accumulations, one per result word.
[SLP]Fix alloca handling in runtime alias check versioning (#227341)
Do not duplicate allocas when versioning a block: keep the leading
static allocas in the header block and reject blocks with any other
alloca. Duplicating them moved static allocas out of the entry block
and merged the clones through a PHI, which is invalid for lifetime
markers.
Fixes #227328
[libc++] Fix use-after-free in the monotonic_buffer benchmark (#227072)
We would release the monotonic_buffer_resource before the closing brace,
which runs the destructor of the list and accesses the nodes.
[libc++] Use a union for uninitialized storage in associative container benchmarks (#227068)
This removes the need for reinterpret_cast when accessing the containers
constructed in the scratch space, and fixes the PMR constructor
benchmark passing the wrong pointer to DoNotOptimize.
TwoAddressInstructions: Add another reschedule copy order test
Another test for the fix from #227289, which hit a different
assert condition.
Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
[libc++] Fix out-of-bounds read in the associative container query benchmarks (#227070)
The query benchmarks for associative containers would access the pool of
keys to use in the benchmark out-of-bounds.
[flang][NFC] Split the OpenACC construct lowering into two lanes
genFIR(OpenACCConstruct) decided twice, in three places, whether the
construct it lowers is structured, and reassigned the evaluation it works
from halfway through: before the descent that evaluation is the construct,
after it the loop the directive absorbs. Everything downstream had to know
which one it was holding.
Give each form its own function and leave genFIR to choose between them.
One lane allocates the exit selector, lowers the evaluations the construct
holds, and emits the jump table; the other reads the collapse clauses,
descends to the absorbed depth, and lowers what is inside it. The prologue
and epilogue are short enough to state in both rather than share.
[flang] Let a directive keep the loop it owns when its body branches
A loop whose branching is confined to its body keeps its structured form,
but the construct holding it stayed unstructured. A directive does not
merely contain such a loop, it owns it, and its lowering reads the
construct's own classification to decide whether the loop op carries its
bounds. The directive was left with a bounds-free loop that nothing could
partition, and the loop it owns became a second one nested inside.
Reclassify a directive construct once the loops it holds no longer need it
to stay unstructured, and fold the body of the loop it takes over into a
region, which the DO lowering can no longer do for it.
A construct whose branching leaves it is untouched, as is one holding a
branch of its own.