Skip to content

Update 2026 07 10 - #31

Merged
SupernaviX merged 126 commits into
mainfrom
update-2026-07-10
Jul 10, 2026
Merged

Update 2026 07 10#31
SupernaviX merged 126 commits into
mainfrom
update-2026-07-10

Conversation

@SupernaviX

Copy link
Copy Markdown
Owner

caught a bad build

SusanTan and others added 30 commits July 9, 2026 14:46
…lare (llvm#208091)

Inlining can leave a `fir.declare`'s dummy_scope operand (`!fir.dscope`)
defined outside an OpenACC compute region while the declare itself gets
rematerialized inside, since `fir.dummy_scope` wasn't registered as an
OutlineRematerializationOpInterface candidate.

This dangling, unmappable live-in is illegal for parallelization. 

Fix: Added `OutlineIdentityOperandOpInterface`, implemented by
`fir.declare/hlfir.declare`, so `OffloadLiveInValueCanonicalization`
drops their dummy_scope operand (an identity token that must never be
duplicated) instead of cloning it when sinking/rematerializing them into
offload regions.
…FC) (llvm#208306)

The canonical form preferred by instCombine is to use 64-bit values for
the index when it is a constant for ExtractElement.
…m#203941)

Canonicalizes explicit broadcasting into implicit broadcasting by
folding the tile input into the binary element-wise operation.
…s from their declaration site (llvm#207429)

Currently, when an explicitly defaulted function is synthesized (e.g.,
at its first use), it erroneously adopts the floating-point (FP) pragma
state of the synthesis site rather than its declaration site. This leads
to mismatched or incorrect FP features being applied to the generated
body, completely ignoring `#pragma STDC FENV_ACCESS` pragmas that were
active when the function was explicitly defaulted.
This change should fix this issue by capturing and restoring the FP
features at the appropriate times.

Fixes llvm#207266 

I also added the following fixes to support the above:
- AST Importer Fix: Updated ASTImporter::VisitFunctionDecl to correctly
import FPFeatures and Lookups for defaulted/deleted functions, whereas
before it was silently dropping them.
- AST Version Bump: Bumped VERSION_MAJOR to 39 in ASTBitCodes.h to
reflect the new FunctionDecl binary layout changes in the AST
serialization.
…tributor Decls (llvm#208346)

The container `std::set<const NamedDecl *>` created a non-deterministic
traversal order for a contributor's `Decls`, making the resulting
representative `Decls[0]` non-deterministic as well.

Also fix typos in assertion messages.

Follow-up to llvm#204482.
…lvm#208000)

Add an attribute which indicates that a call is to an intrinsic
function. Intrinsic here means that the function declaration was found
in a module found in the intrinsic path.

This allows us to, when optimizing, make sure that we correctly identify
calls to intrinsic functions whose behaviours we know, and not
user-defined functions whose names happen to match.
…Set (NFC) (llvm#208509)

This patch replaces std::set with SmallVector and llvm::sort in
SortedCallTargetSet and sortCallTargets.

Since the keys in CallTargetMap are already guaranteed to be unique,
using std::set for sorting allocates unnecessary tree nodes on the
heap.

This patch also removes unnecessary const from return-by-value types
to enable move semantics.

Assisted-by: Antigravity
follow-up to llvm#208462

Using the libcall reduces code size, gives identical output for the full
f16 range, and is apparently quite a bit faster

```
direct f16: 2.067486000 s for 1000 full-range iterations
via f32:    0.714443000 s for 1000 full-range iterations
```
After having dedicated support for modeling the header mask of a region
created for tail-folding, add a new helper to query if a plan has it's
tail folded, i.e. it has a header mask (materialized or not).

Similarly to llvm#207784, it also
adds a wrapper to LoopVectorizationPlanner that asserts that cost model
and VPlan decision agree. The wrapper should be removed after no
divergence are found.

PR: llvm#208329
…template_id (llvm#208119)

DiagnoseMissingSemiAfterTagDefinition checks whether the token after a
tag definition could be a scope specifier before calling
TryAnnotateCXXScopeToken. It accepted annot_template_id unconditionally,
but TryAnnotateCXXScopeToken asserts that MightBeCXXScopeToken() holds,
which only accepts annot_template_id when followed by ::.

When the token is annot_template_id not followed by :: (e.g. union { }
::foo<int>; where ::foo<int> is annotated as a template-id after a
missing semicolon), the check passes but MightBeCXXScopeToken() returns
false, firing the assertion.

This patch adds the same NextToken().is(tok::coloncolon) guard that
MightBeCXXScopeToken uses for annot_template_id.

Fixes llvm#207992

---------

Co-authored-by: Corentin Jabot <corentinjabot@gmail.com>
…lvm#207254)

Partially address llvm#207136

Previously this part of the logic simply converts each operand into
scalable vector and pass on. This will run into problem when the
scalable vector container is larger than the actual fixed vector.
This patch fixes this issue by storing individual fixed vector operands
directly onto the stack, before loading them back with segmented load
just like its scalable vector counterpart
… improve handling of multiple `cleanup` attributes (llvm#207785)

Clang would previously crash on this code:
```c
#define C(x) __attribute__((cleanup(x)))
void foo(double *x) {}
void bar() { C(foo) C(foo) baz8; }
```
Here, we were trying to query properties of `VD->getType()`, which would
crash because type of the variable declaration is null here (because the
user didn’t write a type); avoid this by bailing out early if the
declaration is invalid.

Additionally, this patch fixes a GCC compatibility issue: in code such
as
```c
#define C(x) __attribute__((cleanup(x)))
void f1(double *x);
void f2(double *x);
void bar() { C(f1) C(f2) double x; }
```
Clang would only use the first cleanup attribute, whereas GCC only uses
the last one; I’ve changed our behaviour to match GCC’s and added a
diagnostic that informs the user that only the last cleanup attribute is
actually used.

Fixes llvm#191829.
Small modification in getTSDAndLock() to have a single shared TSD avoid
the tryLock call. Also, remove some unnecessary comments.

Add a DCHECK in getTSDSlow and only check for == 1 since a 0 number of
shared TSDs is not supported.
This would end up introducing a copy between registers
with mismatched sizes previously. Defends against verifier
failures in a future change.

The actual transform here should be deleted. Optimizations should
not be trying to introduce SUBREG_TO_REG.
Given we are shipping binaries, the produced packages are arch-specific
so we need to build/cross-compile on all the architectures that we care
about. Start by getting things working on latest MacOS and Windows.

Reviewers: Michael137, ldionne

Pull Request: llvm#190884
The alignment of sections is set after the section are created. Thus,
the ED structure set at object construction time is updated with the
current section alignment. This only applies to ED type section. As
result, the alignment of global data is correctly set.

Assisted by: IBM Bob
Implements the following compare and swap builtins:
```
int __cs(unsigned int *, unsigned int *, unsigned int), 4 byte compare & swap
int __cs1(void* OP1, void* OP2, void* OP3), 4 byte compare & swap
int __csg(void* OP1, void* OP2, void* OP3), 8 byte compare & swap
int __cds1(void* OP1, void* OP2, void* OP3), 8 byte compare & swap
int __cdsg(void* OP1, void* OP2, void* OP3), 16 byte compare & swap
```
The implementation utilizes the llvm cmpxchg intrinsic to generate the
CS instructions, then it generates a store instruction to store OP2 into
OP1, and finally invert the success flag of cmpxchg by an XOR
instruction with 1 and return the flag.
First, this patch makes the backend consider GPRF16 and GPRF32 registers
as GPR. These registers are aliases of normal GPR but for use with the
Zdinx extension (floating points instructions on GPR).

Second, it teaches the general -fzero-call-used-regs logic to handle
used registers that span over multiple physical registers. One example
of this is `GPRPair` in the RISC-V backend.
This fixes 0f9f5a2.

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=0f9f5a2aba97070971f2d58f2e307f621edf9ada

Co-authored-by: Google Bazel Bot <google-bazel-bot@google.com>
This patch adds stabilizeTable to replace duplicate code involving
O(N) heap allocations and hash lookups.  The new helper function
returns pointers to key-value pairs sorted by key.

Since the keys in MapVector are already guaranteed to be unique,
using std::set for sorting allocates unnecessary tree nodes on the
heap.

Assisted-by: Antigravity
…l lookups (llvm#205448)

`processFuncOp` previously called `funcOp.getSymbolUses(module)` for
every function, which walks the entire module to find that function's
callers. Since `processFuncOp` runs once per function, the pass was
effectively *O(numFunctions * numOperations)*.

Build a `SymbolUserMap` once up front in `runOnOperation()` and look up
each function's callers in *O(1)*, making the collection phase linear in
the size of the module.

This is behavior-preserving: the map is read only during the
mutation-free collection walk, and all IR erasure happens afterwards in
`cleanUpDeadVals`, so the map cannot become stale while it is in use.

---

**Note:** AI used to generate part of the code in this PR.

Signed-off-by: Victor Perez Carrasco <victor.pc.upm@gmail.com>
Co-authored-by: Víctor Pérez Carrasco <victorperez@fb.com>
Co-authored-by: mlevesquedion <mlevesquedion@meta.com>
…capture checker (llvm#201044)

Split alpha.webkit.UncheckedLambdaCapturesChecker off of
UncountedLambdaCapturesChecker, which currently checks for the use of
ref counted objects as well as CheckedPtr capable types unlike all other
WebKit checkers, which only check for one type of smart pointers.

Also improve the wording of the warning text so that it can be easily
extended to support checking for the lambda capturing of raw pointers
and references to CheckedPtr/CheckedRef.
// namespace instead of //namespace.

This is consistent with the LLVM coding standards. We took focus on this
specific case as it was tripping up some of our internal tooling.
clangd/clangd#1787 describes how LLVM's code for removing partially
written files when taking a fatal signal is slower than it should be.
This code was substantially rewritten by JF Bastien in
aa1333a to make it (more) signal-safe.

As written in 2018, the logic always allocates a new node for every file
we attempt to protect, and those nodes are added to a global singly
linked list and never removed. If you open a lot of output files,
suddenly output file opening becomes O(n^2), which is what happened
during clangd indexing.

Removing files on signals in a multi-threaded environment is really
complicated! We can use locks to synchronize between threads that are
writing to the list, but we cannot use locks to synchronize against
re-entrant signals, and we don't have any great tools for masking or
delaying things like SIGTERM. This makes it difficult to assert that we
have the one and only reference to a node, even after removing it from
the linked structure, so we can safely deallocate it.

This implementation sidesteps that problem by reusing nodes on the list
with a null Filename pointer. The Filename is null if the file no longer
needs to be removed. We replace the filename with a different sentinel
while removing files using a CAS operation to simulate a lock acquisition.
* Case 1: This is the normal case, works as intended, the list should
grow in length to the number of concurrently open files that must be
removed on exit, which should be O(# threads)
* Case 2: In this case, the signal handler will leak the filename string
without a GC root for it, which is fine, since we're exiting.

I added a benchmark, and this
change makes it 16x faster, and the profile shows that the time is no
longer mostly spent in this signal handling code.

---------

Co-authored-by: JF Bastien <github@jfbastien.com>
da-viper and others added 28 commits July 10, 2026 09:57
migrate tests module, moduleEvents and moduleSymbols
…ple" (llvm#205133) (llvm#205522)" (llvm#208644)

The change broke the runtimes build for Android; see discussion on the
PR. There are fixes in progress, but let's revert to unbreak the tree
until all those are ready to land.

This reverts commit 00b2f81 and the
follow-up commit 1008b48.
…llvm#208473)

Turn the switch on now that is has been tested.
Will remove the switch in a later patch.
…al concept (llvm#208465)

Mark self-referencial concepts as invalid to prevent them from being
evaluated (which would crash).

Fixes llvm#206336
…8195)

Add missing LLVM version string to `DW_AT_producer` in
`__artificial_type_unit`.

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
The function `if_nameindex` has 0 arguments but `MallocChecker` expected
it to have 1 argument and was not recognized by the checker correctly.
…208643)

LLDB currently fails to find TLS variables on Linux, and this is part of
the problem.
…8277)

An x86 instruction can be at most 15 bytes. The decoder already checks
for overruns but only emits an `LLVM_DEBUG` message and still returns
`Success`. This patch returns `Fail` instead, so `getInstruction()`
never reports a size
that isn't a valid instruction length.
llvm#208668)

Ensure x86 has pdep/pext cost coverage for llvm#207657

NOTE: This is mainly a crash/sanity testfile, they aren't necessarily
accurate
The external entry point is not available in overlay mode, causing this
test to not run there. Other tests also use the internal function.
The configured offload system target is now amdgpu-amd-amdhsa since
 d776ee4.
…vm#208013)

Addressing case missed by llvm#194859.

Detect the reduction update by checking both incoming values to
determine which is the single use incoming blend value, rather than the
previous approach which always assumed this would be incoming value 0.
- Fix element size calculation when processing sub-byte types
- Add tests for i1 and i4

Signed-off-by: Iliyan Georgiev  <Iliyan.Georgiev@arm.com>
…lvm#206792)

Python 3.14 (PEP 765) warns about return statements inside finally
blocks. This warning breaks intercept-build and friends for configure
scripts.

The bare except already catches everything, so falling through to the
return is equivalent and silences the SyntaxWarning.
I moved the poison replacement step before cleanup paths that can drop
uses and leave queued operands temporarily null. This keeps region
branch operands valid while the later cleanup removes dead arguments and
results.
Fixes llvm#206094
…07720)

Fold zext(cmpne(ptrue, x, 0)) to umin(ptrue, x, 1).

Do not fold non-ptrue predicates, since cmpne zeros inactive lanes and
umin merges inactive lanes
Change it from VPIRValue -> VPValue, as several usecases require it,
while adding a check in the verifier.
Let the declared_at note point to the declaration in that case.
…04808)

buildHvxVectorReg packs small element vectors into i32 words before
using the most frequent word to initialize the HVX vector. For i8/i16
result vectors, the old lowering created SPLAT_VECTOR with the final
vector type, which selected a byte or halfword splat and broadcast only
the low part of the packed word.

The idea is to build the splat as a vector of i32 words first, then
bitcast back to the final vector type. This preserves the full packed
word while keeping normal byte and halfword scalar splat lowering
unchanged.

The test covers packed-word i8 and i16 cases, and also checks that true
i8/i16 scalar splats still lower to byte/halfword splats.

After testing with the SDK simulator, it looks to me like a larger
16-byte repeated-pattern case is still miscompiled after this change. It
appears to be a broader issue in this build-vector construction path, so
maybe this should be addressed in a different way that could fix all
cases and not only these specific ones. Please let me know what you
think.

I have used AI for this proposal. The bug was originally found after
running llvm-reduce on a large ll that had a completely unrelated bug.

Co-authored-by: L-roro <rodriguez@roofline.ai>
An internal review flagged the use of `getenv` when reading the OMPT
tool library path from the environment and passing it to the loader as a
potential vuln.

This patch replaces the use of getenv in question with the use of
secure_getenv on glibc platforms.
On non glibc platforms, no change is implemented.
…llvm#208696)

Add orc_rt_log_Category_getName, orc_rt_log_Level_getName, and
orc_rt_log_Level_parse. These are independent of the logging backend and
will be used by the printf backend and by upcoming test tools.
Add support for gfx6/7 families.
These subtargets don't support 64-bit Scalar Compares
or S_MUL_HI_U32. Added workarounds for these where
they come up in the code path.
…m#208697)

Rename ORC_RT_LOG_LEVEL_NONE to ORC_RT_LOG_LEVEL_OFF. The old name
collided with the "none" backend (a different mechanism) and could be
misread as "no filtering" rather than "no output"; "off" avoids both
issues.
@SupernaviX
SupernaviX merged commit 79212dd into main Jul 10, 2026
6 checks passed
@SupernaviX
SupernaviX deleted the update-2026-07-10 branch July 10, 2026 15:58
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.