[llvm-exegesis] Fix ~27 minute stall when no LBR sample arrives (#218102)
X86LbrPerfEvent programs PERF_TYPE_RAW/0x20c4, a P-core encoding. A
hybrid CPU registers one PMU per core type and cpu_core claims
PERF_TYPE_RAW, so the kernel never schedules the event while the thread
runs on an E-core. perf_event_open succeeds all the same and no sample
is recorded.
doReadCounter polls 160 times with a 10s timeout, so reporting the
failure takes ~27 minutes, and checkLbrSupport then aborts instead of
reporting it, never having consumed the Expected error. lit.local.cfg
probes llvm-exegesis at test discovery, so with LLVM_ENABLE_LIBPFM=ON
this stalls all of check-llvm before any test runs.
The event is disabled before we poll, so a sample either is already in
the ring buffer -- wakeup_events == 1 leaves POLLIN asserted -- or it
will never arrive. Poll 3 times with a 1s timeout, use
expectedToOptional, and bound the lit probe. A probe that works at all
takes under 30ms, 0.08s with every core saturated.
[3 lines not shown]
[Analysis] Fix the build (#218559)
This patch fixes:
llvm/lib/Analysis/AliasSetTracker.cpp:336:31: error: no member named
'ModAccess' in 'llvm::AliasSet'
[HLSL][NFC] Generalize and consolidate the texture tests
Many of the texture tests were parameterized specifically for Texture2D
and Texture2DArray, therefore retaining several 2D-specific literals,
including: the `hlsl::dimension` spelling, the width of the offset / ddx
/ ddy / LOD-location vectors, the operator[] index type and the
`spirv.Image` Dim operand.
Furthermore, the macro names used for parameterization was inconsistent
among test files.
This commit re-parameterizes the texture tests to generalize to more than
only 2D textures, and keeps the macro names consistent across test files.
Each test file now also has a comment describing each macro used in the
test.
This commit also moves 3 misplaced texture tests under
clang/test/SemaHLSL into clang/test/SemaHLSL/Resources.
[2 lines not shown]
[ADT] Clean up and fix FoldingSetBase move operations (#217453)
[ADT] Clean up and fix FoldingSetBase move operations
This patch cleans up move operations in FoldingSetBase and fixes a bug
in self-move assignment.
First, we add default member initializers to FoldingSetBase and use
std::exchange in move operations to streamline transferring member
variables while resetting the moved-from object to an empty state in a
self-contained manner.
Second, we add a self-assignment check to the move assignment operator.
Without this check, self-move assignment executes free(Buckets) before
any transfer occurs, unconditionally destroying the set. The check makes
self-move a safe no-op.
Assisted-by: Antigravity
[docs] Finish MyST migration for PDB, DirectX, and GlobalISel docs (#217159)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is a stacked PR based on #217157 , which will be a standalone
commit that
renames *.rst -> *.md before this PR lands for history preservation
purposes.
This was prepared with rst2myst plus LLM-assisted cleanup.
I rendered the HTML and ran a pixel differ over it, and all the diffs
look intended, but I have *not* gone over the markup in detail. I
encourage reviewers to try to spot check content they care about, or
look at complex constructs and prioritize reviewing those, rather than
fixating on markup nits.
[140 lines not shown]
[docs] Rename selected PDB, DirectX, and GlobalISel docs to Markdown (#217157)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the initial straight rename commit. It will probably break the
docs build, but it has to be a separate PR for blame preservation
purposes.
[flang][OpenMP] Lower DO, SIMD, and DO SIMD metadirective variants
A standalone metadirective and its associated loop are represented as
sibling PFT evaluations. For example:
```
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
a(i) = i
end do
```
has the following evaluation shape:
```
METADIRECTIVE
DO
[25 lines not shown]
[LLVMABI][AARCH64] Handle records that cannot be passed in registers (#217689)
This adds AArch64 handling in the LLVM ABI library for classifying
record arguments as Indirect when the record type cannot be passed in
registers.
The `getRecordArgABI` function was already implemented in the
`TargetInfo` base class, making this a trivial update.
Assisted-by: Cursor / Grok 4.5 (test generation)
[flang][OpenMP] Lower DO, SIMD, and DO SIMD metadirective variants
A standalone metadirective and its associated loop are represented as
sibling PFT evaluations. For example:
```
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
a(i) = i
end do
```
has the following evaluation shape:
```
METADIRECTIVE
DO
[25 lines not shown]
[flang][OpenMP] Lower DO, SIMD, and DO SIMD metadirective variants
A standalone metadirective and its associated loop are represented as
sibling PFT evaluations. For example:
```
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
a(i) = i
end do
```
has the following evaluation shape:
```
METADIRECTIVE
DO
[25 lines not shown]
[LICM] Ignore AA tags on conditional stores in scalar promotion. (#218031)
One of the key aspects of scalar promotion, as done in LICM, is that the
store is always unconditional: it executes even if the store in the loop
didn't execute. This makes the aliasing check more complicated: we need
to ensure that it's okay to both sink the store out of the loop, and
speculatively execute the store.
For the sinking, it's fine to use AA tags, but for speculatively
executing the store, it's a problem: AA tags are only meaningful for
operations that actually execute at runtime. Existing code will strip
the AA tags from the generated store, but still used them for the
aliasing checks.
The new isStrongerThanMonotonic() checks don't affect correctness; this
change is just moving the checks earlier because of the way the
AliasSetTracker data structure works.
Fixes #60860. Fixes #217052.
[VPlan][Predicator] Preserve some uniform control flow
Implements "Partial Control-Flow Linearization" by Simon Moll and
Sebastian Hack. Does **NOT** improve predication/masking yet, so
applicability is artificially narrowed, only some uniform branches are
preserved. In particular, the following is left for future PRs:
* Block masks still contains now-unnecessary term for the preserved
uniform branches.
* Mixed blends/phis aren't supported yet. Detecting where they would be
necessary is as complex as implementing proper support (which would
need either Luke's `reconstructSSA` or Iterated Dominance Frontier),
so we also limit it to a trivial/structured CFG where there's only
single block where those would need to be inserted.
I think even the current version might be enough to start implementing
an alternative to https://github.com/llvm/llvm-project/pull/141900 (see
BOSCC in the paper).