Skip to content

Update 2026-05-30 - #29

Merged
SupernaviX merged 5455 commits into
mainfrom
update-2026-05-30
May 31, 2026
Merged

Update 2026-05-30#29
SupernaviX merged 5455 commits into
mainfrom
update-2026-05-30

Conversation

@SupernaviX

Copy link
Copy Markdown
Owner

been a minute

Also updates the ubuntu version which releases are built against and disables python support in lldb. both of which will hopefully make lldb easier to use on newer OSes.

H-G-Hristov and others added 30 commits May 28, 2026 21:59
This adds test coverage for llvm#199813. Hopefully this will prevent gisel
from
getting worse.
…lvm#198193)

Enforce read-only behavior on lit_config.maxIndividualTestTime after
initialization to prevent test suites from modifying it globally, and
add a core lit test to verify this behavior.

PR Stack:
* llvm#198192
* llvm#199886
* llvm#199996
* ➤ llvm#198193

Assisted-by: Gemini
llvm#188844)

Fixes

llvm#56777
llvm#58098
llvm#64955

Non-const member functions don't mutate the pointer but the pointee.
Pointee mutations follow different path within the analyzer, so should
not be effected.

Edit to old tests were needed. Adds a dedicated tests besides those.
This patch implements the missing API for accessing the DAG successors.
This includes the successor iterators and DAG Node member functions like
succs(). These are mirroring the existing predecessor API.
…unt and tryToRecognizePopCount2n3. (llvm#199440)

Both of these patterns end with code to compute the popcount of each
byte.

This isn't NFC because tryToRecognizePopCount2n3 handled an alternate
pattern for one of the steps and tryToRecognizePopCount used
MaskedValueIsZero. The shared code applies these differences to both
cases. New tests have been added.

Assisted-by: Claude Sonnet 4.6

---------

Co-authored-by: Min-Yih Hsu <min@myhsu.dev>
…nk:) (llvm#200193)

A standalone ordered construct using the pre-OpenMP 5.2 depend(source) /
depend(sink:) spelling crashed flang with an assertion failure in
buildConstructQueue ("Construct decomposition failed"), or emitted a
TODO when assertions were disabled.

These dependence types are valid on ordered since OpenMP 4.5, but flang
represents them internally as a doacross clause, which construct
decomposition only accepts from OpenMP 5.2. As a result, decomposition
produced an empty output and tripped the assertion at every OpenMP
version below 5.2 (including the default 3.1).

Lowering of the standalone ordered directive is not implemented yet
(genOrderedOp only emits a "not yet implemented" message and ignores the
construct queue). Build the construct queue only for the
block-associated variant and emit the TODO directly for the standalone
directive, so the decomposition that would otherwise assert is no longer
reached.

Note: at versions below 4.5 the construct is technically invalid, but
flang's semantics accepts it silently. Making semantics emit a "requires
OpenMP 4.5" error/warning is probably a good idea.

Fixes llvm#198972
…formation (llvm#197607)

Loads, stores, and later probably calls, can request a base pointer info
object from the user runtime. This object is queried right after the
base pointer of the operation is defined, and then passed to the
pre/post runtime calls of the loads and stores. This allows users to
inspect pointers early and once, but provide the analysis results to all
operations that might be executed in loops. A potential use case is to
lookup the size and start of the underlying object and then provide
those to the access runtime calls for in-bounds checking.
Although the change could be functional in theory, it is very difficult
to find a test case.
CIRGen was attaching `nsw` to `cir.add` on `!cir.vector` integer types
because the signed-overflow path keys off `compType` (the element type,
still `!s32i`), while the verifier only allows `nsw`/`nuw` on scalar
`!cir.int` results.  That mismatch showed up 144 times in the libcxx
CIR sweep on `std::experimental::simd` — `experimental/__simd/vec_ext.h`
increment/decrement (`__data + 1` / `__data - 1`).

Classic CodeGen never enters the signed-overflow block for vector
computation types; CIR now skips the scalar `nsw`/`nuw` path when the
MLIR operand is an integer vector, and uses `getAs<VectorType>()` for
`compType` so typedef-wrapped GCC vectors resolve the element type
correctly.

Regression test `vector-binop-overflow.cpp` checks scalar add still gets
`nsw` and vector add/sub/mul do not (CIR + LLVM + OGCG).
)

We now allow to have instrumentation opportunities for many instructions
(=opcodes) to bundle common classes together. Users can use filters on
the opcode, type-id, and size to statically select what they are
interested in.

Coded with Claude.
…d libs (llvm#174266)

When any symbol in a DLL carries dllexport, the MinGW/Cygwin linker
switches to exclusive-export mode and omits all other symbols from the
export table. LLVMOrcTargetProcess uses LLVM_ALWAYS_EXPORT (__declspec(
dllexport)) so its symbols can be found via GetProcAddress from a
statically linked executable, which triggers this behaviour.

Add --export-all-symbols to LLVMOrcTargetProcess for MinGW/Cygwin
BUILD_SHARED_LIBS builds to restore full symbol export.
Initialize SplatBitSize to fix use-of-uninitialized-value error detected
by MemorySanitizer in ba7d42b.
Instead of using the passed Ptr argument to get the type, to retrieve
the address space, directly retrieve it from MICA.

This fixes a crash when Ptr is nullptr, as after llvm#200049.

Fixes llvm#200199.
…CopyMI (llvm#197776)

When TargetInstrInfo::foldMemoryOperand produces a side-effect CopyMI,
the copy destination vreg's LiveInterval is extended via addSegment. If
that vreg is already assigned in LiveRegMatrix, the matrix becomes
inconsistent because it still holds the old (smaller) interval.

Fix this in two places:

- InlineSpiller::foldMemoryOperand: unassign the vreg from the matrix
before addSegment, reassign after, so the matrix reflects the updated
interval.

- LiveRangeEdit::foldAsLoad: notify the delegate via
LRE_WillShrinkVirtReg before addSegment.

LIT test exercised by this patch (i.e. if I introduce consistency
verification as in llvm#197778 but
not this patch, the following test fails):
CodeGen/X86/apx/pr191368.ll

Assisted-by: Cursor/Claude Opus
…llvm#195374)

This removes the final use of RELEASE_TASKS_USER_TOKEN secret. It
required plumbing the secrets in thrugh several levels of workflow
calls, which is not ideal, but I don't see a better way to do this.
`processthreadsapi.h` needs to be included after `windows.h`.
clang-format needs to be disabled here to avoid sorting the includes.

Fixes the test failure from
llvm#199983 (comment).
…#200066)

This came up in a test suite, the frontend considers 'bool' to be
integral enough to use as a bounds, so bool makes it through to the VLA
codegen. This patch adds a new cast function that takes a bool or int
type and casts it to an int (as this is a pretty useful task, that I
    believe I've seen before).
…200084)

Fixes two bugs. The bug which prompted this change is that `frame
variable name` would
print all regcognizer arguments, even though only "name" was requested.

While making a test for the first bug, I found that `frame variable
recognizer_arg` will
both successfully print the variable, and also report a false positive
error:

```
error: <user expression>:1:1: use of undeclared identifier 'recognizer_arg'
      1 | recognizer_arg
```

This change fixes both bugs, including when using `--regex`.
…d tests (llvm#200258)

## Summary
This PR fixes test failures in `llvm-offload-binary.ll` on z/OS (and
potentially other EBCDIC platforms) by splitting the malformed file
tests into a separate test file.

## Problem
The test was failing on z/OS because it uses `printf` with octal escape
sequences to create malformed binary test data:
```bash
printf "\020\377\020\255\012" > %t9
```

On z/OS, the shell's I/O redirection performs automatic EBCDIC-to-ASCII
translation on the output from `printf`. This means the binary data
written to the file gets translated, resulting in different bytes than
intended. The malformed test data is therefore not created correctly,
causing `llvm-offload-binary` to fail in unexpected ways or not produce
the expected error messages.

## Benefits of this solution
- Main test file now passes on all platforms including z/OS
- Malformed file error handling tests are preserved for ASCII-based
systems
- Clear separation of concerns between standard tests and
platform-specific tests
- No loss of test coverage on supported platforms
…0281)

Teach ArraySectionAnalyzer to use the scheduler's value-equivalence
callback
when comparing hlfir.designate base memrefs. This lets HLFIR ordered
assignment
lowering recognize allocatable WHERE self-updates as aligned even when
the LHS
and RHS use distinct descriptor loads.

This avoids generating full-sized RHS temporaries for these masked
self-updates, preventing device heap exhaustion while preserving
parallel
kernel generation. Add a regression test for allocatable WHERE section
scheduling.
This adds documentation for a couple common review comments I've seen:
1. Extraneous target triples/data-layouts
2. Tests not getting put in the right folder (especially when they
require a target and are not put in the target-specific subfolder)
3. Extraneous FileCheck prefixes.
RKSimon and others added 28 commits May 30, 2026 07:52
…l shift patterns" (llvm#200546)

Reverts llvm#200136 while I investigate a miscompilation report
…200332)

Previously SelectionDAG used the natural alignment of the value type,
even if the instruction specified a different alignment.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
…200344)

`hoistAdd`/`hoistSub` turn `LV + C1 <pred> C2` into `LV <pred> C2 - C1`,
changing the icmp's LHS. A `samesign` flag asserted about the old
operands need not hold for the new LHS, so keeping it can turn a defined
comparison into poison (e.g. for `%iv = -3`, `samesign slt(2, 100)` is
true but the reassociated `samesign slt(-3, 95)` has
opposite-sign operands → poison). Drop the icmp's poison-generating
flags after the rewrite, as `hoistMulAddAssociation` already does.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
llvm#200346)

MergeICmps looks for cases like

    struct S { char x; char y; }
    A.x == B.x && A.y == B.y

If `x` and `y` are stored adjacent to one another, we can convert the
above into a memcmp, which can then be converted into a single 16-bit
compare.

This pass currently does the wrong thing if the struct members' sizes
are not multiples of 8 bits. To fix this, we simply bail if the elements
in question are not multiples of one byte.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.
A reviewer in llvm#200012 required checking for a leading (back-)slash to
the test despite none of the other tests doing so. Turns out, the slash
isn't there if the driver is unable to resolve the full path to the
linker. Remove the leading slash from the test.

Fixes reported buildbot failures:
 * clang-solaris11-sparcv9
 * clang-solaris11-amd64
Add a byte-reversal loop fallback for `std::byteswap` when `sizeof(T) >
16`,
so the function works for `_BitInt(N)` with `N > 128` and any future
wider
integer type. Without it, those calls hit `static_assert(sizeof(_Tp) ==
0)`
and fail to compile.

Reject `_BitInt(N)` where `N` is not a multiple of `CHAR_BIT`. The
existing
`__builtin_bswap{16,32,64,128}` paths swap the storage representation
including padding bits, and the resulting value's meaning is
unspecified.
A new `static_assert` catches that case and reports it. Size-1 types are
exempt from the check, since no bytes move there.

Part of the [_BitInt(N) libc++
effort](https://discourse.llvm.org/t/bitint-n-support-in-libc-investigations-possible-improvements-looking-for-guidance/90063).

Assisted-by: Claude (Anthropic)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…guments (llvm#199483)

Until now, strict behavior in the number of threads and blocks has been
applied only when the kernel is in bare mode. When this mode is enabled,
the values passed in UserNumBlocks and UserThreadLimit are not adjusted
and are the definitive values used to launch the kernel. This commit
detaches the strictness from the kernel mode.

This is going to be used by the kernel replay tool. Additionally, it
starts clearing the path for the upcoming OpenMP dims modifier, used to
configure multidimensional teams and leagues, which will include
strictness choices for teams and threads.

All the bare kernels must indicate strict behavior. Asserts are added to
check this condition.
- Add `-DCOMPILER_RT_BUILD_PROFILE_ROCM=1`
- Prune `"lib/sanitizer_common/*.S"`, it means `*.inc.S`
- Add `-fvisibility=hidden`

Bazel doesn't add `-gline-tables-only` by default. Add flags to CMake
side to align the build to Bazel.

- `-DCOMPILER_RT_HAS_G_FLAG=OFF`
- `-DCOMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG=OFF`
A bundle may duplicate a previously built node that has copyable elements
(same schedulable instructions, different copyable lane) while the parent
node also has copyable elements. An operand modeled as a copyable element
in the previous node is then used directly by the new node, which is not
registered in the tree yet. Recomputing that operand's direct
dependencies at this point misses the direct use, so the scheduler
decrements the operand more times than its dependency count and trips the
unscheduled-deps assertion.
Defer recomputation of such operand dependencies via
RecalcCopyableOperandDeps and redo it at the next bundle scheduling, when
the duplicate node is part of the tree. Also clear and recompute the
direct dependencies of bundles whose user is a gather node referenced
through EdgeIdx == UINT_MAX in scheduleBlock, so combined gather
sub-entries get correct dependencies against the full tree.

Reviewers: 

Pull Request: llvm#200564
…oops

getScaleToLoopIterations() used U->getParent() for all PHI-node external
users. For an LCSSA phi at an inner-loop exit still inside an outer loop,
this gave outer-loop scale instead of inner*outer scale. Because
ExtractCostCalculated deduplicates by scalar, only the first ExternalUser
determines the scale, making the cost order-dependent on use-list ordering
(and thus on .ll block ordering).

Reviewers: hiraditya, RKSimon, bababuck

Pull Request: llvm#199954
Reformat attach-targets.mlir so each GPU module has a labeled check
block, split target-attachment RUN lines, and keep comments tied to the
expected target-specific matches.
ExtractCostCalculated deduplicates by scalar so only the first
ExternalUser determines the scale, making the cost depend on IR block
ordering via LLVM's reverse-insertion use-list order.
Add a pre-pass computing ScalarToExtractBlock - the nearest common
dominator of all effective extract sites per scalar. For PHI users inside
a loop the effective site is the incoming block; for PHI users outside
all loops it is the PHI's own block (scale = 1). The extract cost is
then scaled by getLoopNestScale of the NCD block, which is fully
order-independent.

Fixes llvm#199548

Reviewers: bababuck, RKSimon, hiraditya

Pull Request: llvm#199962
…00393)

Calling Integral::getPtr() shouldn't happen for AddrLabelDiff integrals.
…C) (llvm#200255)

Set the scalar type for VPBlendRecipe and VPExpressionRecipe at
construction time, instead of inferring it on demand via VPTypeAnalysis.
With this change, all VPValues have their scalar type set at
construction, so VPTypeAnalysis::inferScalarType becomes a thin wrapper
around VPValue::getScalarType.

To be removed in a follow-up:
llvm#200256.

PR: llvm#200255
Update the assertion text to match the actual code behavior.
Some functions enforce strictly positive values, whereas the error
message incorrectly mentioned "nonnegative".
Clang's TBAA grants the [basic.lval]/11.3 char-aliasing privilege only
to the named ::std::byte type (Type::isStdByteType() requires the enum
to be declared in the std namespace). LIBC_NAMESPACE::cpp::byte lives in
libc's cpp namespace, so it gets its own TBAA node disjoint from char
even though it has the same shape as std::byte.

That mismatch lets the optimizer reorder typed loads past raw-byte
writes through cpp::byte *, miscompiling HeapSort on rv64/Release
(UnsortedThreeElementArray{1,2,3}, UnsortedTwoElementArray1 in
SortingTest.h). The same hazard is latent in every cpp::byte *-based
raw-aliasing site: memory_utils Ptr/CPtr, lsearch/lfind, block.h and
freelist_heap.h allocator metadata.

Tag the type with gnu::may_alias so accesses through cpp::byte * share
the universal char-aliasing TBAA node, fixing all of the above in one
place. This patch also reverts PR llvm#194171, as the may_alias attribute
fixes it too.
Mark Complex visitExpr as unsupported, similar to Clang ORCG, not as NYI
@SupernaviX
SupernaviX merged commit b717899 into main May 31, 2026
@SupernaviX
SupernaviX deleted the update-2026-05-30 branch May 31, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.