[ProfCheck] Annotate/verify memop VP metadata
This patch makes profcheck (optionally) inject/verify memory operation
VP metadata for variable sized memory operations. This is off by default
for now as it causes another ~50 tests to fail under profcheck.
Reviewers: mtrofin, david-xl, snehasish
Pull Request: https://github.com/llvm/llvm-project/pull/243582
[ProfCheck] Annotate/verify indirect call VP metadata
This patch makes prof-inject add VP metadata to indirect calls and makes
prof-verify assert that indirect calls have VP metadata. This is left
off by default for now as it makes ~60 additional tests fail under the
ProfCheck configuration.
Replaces #154657.
Co-Authored-By: Mircea Trofin <mtrofin at google.com>
Reviewers: mtrofin, snehasish, david-xl
Pull Request: https://github.com/llvm/llvm-project/pull/243581
[RISCV] Sort the CPU list returned by fillValid(Tune)CPUArchList (#243708)
This puts vendor tune CPU names with their regular CPU names.
This will also affect the output of #243697
[AllocToken] Infer the allocated type from placement new into the result (#241548)
-fsanitize=alloc-token infers the type of an untyped allocation (malloc,
size-returning new, alloc_size functions) from a sizeof in the size
argument or a cast of the result. The common "allocate raw storage, then
construct in place" idiom has neither:
void *mem = alloc(size);
T *obj = new (mem) T();
and so gets the fallback token, which misplaces the object under a
pointer-split token mode. Add placement new as a third source. The order
is sizeof, then placement new, then cast: a sizeof states what the
allocation was sized for (it may be a header plus elements placed by
pointer arithmetic), while a cast to a raw storage pointer carries less
information than the construction. Only the reserved global placement
form is considered; the storage is matched through parentheses, casts,
and the non-static fields of a by-value result (res.p of a
size-returning allocation). A local variable is used only if it is
[8 lines not shown]
[lldb] Fix a crash in SBEvent::GetBroadcasterClass (#243736)
An event has no broadcaster until it is broadcast. Return "unknown
class" instead of dereferencing null.
Assisted-by: Claude
[LAA] Allow runtime checks between comparable address spaces. (#229588)
If casts between address spaces are no-ops, both address spaces
are integral and they have the same size, the pointers in the address
space should be guaranteed not to overlap. Otherwise the same
address would point to different objects.
In this case, we can compare them and generate runtime checks.
Fixes https://github.com/llvm/llvm-project/issues/229278.
PR: https://github.com/llvm/llvm-project/pull/229588
[AMDGPU] Add missing EXTLOAD/TRUNCSTORE legalization for v{5,6,7}f16 (#243383)
The legalization actions for EXTLOADs of v{5,6,7}f16 to corresponding
f32 types and TRUNCSTOREs from v{5,7}f32 to corresponding f16 types were
never added after those MVTs were introduced in 9b5502292d8e4 ("[CG] Add
VTs for v[567]i1 and v[567]f16").
Add the legalization actions and corresponding tests, also for the
preexisting TRUNCSTORE to v6f16 handling.
Fixes ROCM-33452.
Co-authored-by: Jacob Lambert <jacob.lambert at amd.com>
[LoopUtils] Check the first outer iteration for co-moving pointer groups
When runtime checks are hoisted out of the outer loop, the range of each
pointer group is widened to cover all iterations of the outer loop. If both
groups of a check advance by the same step in the outer loop, e.g. two rows
of the same image:
```cpp
for (y = 0; y < H; y += 2)
for (x = 0; x < n; x++) {
img[y*S + 3*x] = ...;
img[(y+1)*S + 3*x] = ...;
}
```
the widened ranges overlap as soon as the outer loop runs twice, so the
check always fails and the vector loop never runs.
If all bounds of both groups are affine AddRecs of the outer loop with the
[7 lines not shown]
[LoopUtils] Factor out the same-step check of runtime check bounds (NFC)
The follow-up change uses four SCEV expressions for this type of change
so it also generalizes it to take an array.
[LoopUtils][LV] Compute runtime check bounds per check (NFCI)
getRuntimeCheckBounds takes a single pointer group, but the bounds to use
for one group can depend on the group it is checked against.
This changes RuntimePointerCheck to include bounds of both of its groups.
RuntimeCheckBounds takes the new role of covering both groups and
RuntimeCheckGroupBounds covering single group bounds.
The per-group logic moved unchanged into a static helper.
In VPlan's createRuntimeChecks, compute and expand the bounds of each check
right before its compares, in a single loop over the checks, instead of
caching the expanded bounds per group.
We can do it because VPSCEVExpander already reuses expansions of the same SCEV,
and VPlan's CSE merges the resulting duplicate freezes.
As the result, this change only affects the order of the instructions in
the runtime checks.
[flang-rt] Consume the whole field in B/O/Z input (#243678)
EditBOZInput reads a fixed-width field twice: the first pass counts the
significant digits, then it rewinds to the first significant digit and
the second pass decodes exactly that many digits. Nothing moved the
position back to the end of the field afterwards, so the next edit
descriptor started reading right after the last significant digit:
s = '1F XY'; read (s, '(z6,a2)') i, c ! c was ' ', not 'XY'
s = '1f,2'; read (s, '(z4,i2)') i, j ! j was 0, not 2
The second pass also called GotChar() again for each character it
re-read, so READ(SIZE=) counted the significant digits twice (8 instead
of 6 for '(z6)' on ' 1F ').
Record the position reached at the end of the first pass, which is past
any trailing blanks and any separator that ended the field early, and
return to it after decoding. Undo the SIZE= count of the re-read
characters.
[11 lines not shown]
[libc++][Android] Clean up pre-API-23 carveouts and document LIBCXX-ANDROID-FIXMEs
Due to updating the Android sysroot and compiler in previous upgrades, certain test configurations can be updated by switching them from `UNSUPPORTED` to `XFAIL` and dropping obsolete API carveouts. In addition, document root cause and resolutions for other `LIBCXX-ANDROID-FIXME`.
Assisted-by: Gemini
[libc++][Android] Update compiler to r614150 for Android libc++ builders (#243691)
Libc++ is dropping Clang 21 in
https://github.com/llvm/llvm-project/pull/231580 so upgrade Android's
compiler from r596125 to r614150. Android's r614150 compiler was cut
before `__builtin_clear_padding` landed, causing the atomic padding
tests to fail so we also marked those tests as `UNSUPPORTED:
LIBCXX-ANDROID-FIXME` until the next compiler update.
Assisted-by: Gemini
SystemZ: Use LastSubtargetCache in getSubtargetImpl (#242777)
Migrate to the new common pattern and infrastructure.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MustExecute] Define the block context helpers out of line
They use BasicBlock, which MustExecute.h only declares, so the header
did not compile without precompiled headers.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Price uniform constant loads by their dword count (#242550)
Drop the model of how legalization splits and widens a scalar load whose
size is not a legal number of dwords. It is a lot of code for a few rare
shapes.
Addresses post-merge review in #238840
[OpenMP] Compare ISA names when a selector requires more traits (#242465)
isStrictSubset compared ISA names only when both selectors required the
same number of traits. When the second selector required more, the first
was a strict subset even if the second didn't require its ISA names, so
with
```
#pragma omp metadirective when(device = {isa("sse")} : parallel) \
when(device = {isa("sse2")}, user = {condition(1)} : single)
```
both WHEN clauses score the same and SINGLE was selected, although
neither selector is a subset of the other and the first one should win.
Compare the ISA names before checking whether the count is strict.
Assisted with Copilot and Clause Opus 5.5.
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
[AArch64] Test inexact-match overlap WAW is not clustered(NFC) (#243900)
Currently we only cluster exact-match WAW. Add a missing representative
tests that we dont cluster inexact overlap. AES requires FPR128 so it
cannot be easily tested.