Skip to content

[pull] main from llvm:main#1421

Merged
pull[bot] merged 17 commits into
optimizecompile:mainfrom
llvm:main
May 17, 2026
Merged

[pull] main from llvm:main#1421
pull[bot] merged 17 commits into
optimizecompile:mainfrom
llvm:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 17, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

RKSimon and others added 17 commits May 17, 2026 18:00
…98185)

Noticed while working on cleaning up VECREDUCE_ADD handling
The AArch64 backend was silently ignoring inline assembly clobbers when
numeric register names (x29, x30) were used instead of their
architectural aliases (fp, lr). I found this bug via inline assembly
in Zig, which not normalize the register names the way clang does.

There is an incoplete workaround for this in Rust, but that only
handles `x30/lr`, not `x29/fp`. I thought it would make
sense to fix this properly rather than adding a workaround to Zig.

This patch adds explicit handling in getRegForInlineAsmConstraint() to
map both numeric and alias forms to the correct physical registers,
following the same pattern used by the RISC-V backend.

I've left `x31/sp` without changes, it would nice to have to have
warning when trying to clobber `x31`, just like there is for `sp`,
but that register needs different handling, so it's best done
separately.

If you have code like this:

    define void @clobber_x30() nounwind {
      tail call void asm sideeffect "nop", "~{x30}"()
      ret void
    }

Here is the generated assembly before:

    clobber_x30:                            // @clobber_x30
            //APP
            nop
            //NO_APP
            ret

And after:

    clobber_x30:                            // @clobber_x30
str x30, [sp, #-16]! // 8-byte Folded Spill
            //APP
            nop
            //NO_APP
ldr x30, [sp], #16 // 8-byte Folded Reload
            ret
)

The ConvertFToS usage only works when y is an integer. Use it only for
integer constants, for others: lower as GL.Exp(y * GL.Log(x))
…198164)

When switching `clang++` to the default Solaris 11.4 compilation
environment, XPG7 + extensions, two tests `FAIL`:

```
  AddressSanitizer-i386-sunos :: TestCases/Posix/coverage-module-unloaded.cpp
  AddressSanitizer-i386-sunos-dynamic :: TestCases/Posix/coverage-module-unloaded.cpp

  SanitizerCommon-asan-i386-SunOS :: get_module_and_offset_for_pc.cpp
  SanitizerCommon-ubsan-i386-SunOS :: get_module_and_offset_for_pc.cpp
  SanitizerCommon-ubsan-x86_64-SunOS :: get_module_and_offset_for_pc.cpp
```

The failure mode is the same in both cases: the tests fail to link with
`main` undefined. This happens because `<sys/mman.h>` defines

```
#define	SHARED		0x10
```

for the benefit of the Solaris-specific `memcntl(2)`. This was
previously hidden since `clang++` defined `_XOPEN_SOURCE=600`. This
interferes with the use of `SHARED` in the tests.

While I'm the first to admit that such a generic identifier is highly
unfortunate, this is also true for the tests. The interface goes all the
way back to Solaris 1.0/SunOS 4, thus isn't going to change.

This patch fixes this by following the lead of other tests that use
`SHARED_LIB` instead of `SHARED` for this purpose.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
…ion (#198158)

When switching `clang++` to the default Solaris 11.4 compilation
environment, XPG7 + extensions, `sanitizer_platform_limits_solaris.cpp`
fails to compile:

```
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp:93:53: error: use of undeclared identifier 'ucontext_t'; did you mean 'ucontext_t_sz'?
   93 |   unsigned ucontext_t_sz(void *ctx) { return sizeof(ucontext_t); }
      |                                                     ^~~~~~~~~~
      |                                                     ucontext_t_sz
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp:93:12: note: 'ucontext_t_sz' declared here
   93 |   unsigned ucontext_t_sz(void *ctx) { return sizeof(ucontext_t); }
      |            ^
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp:93:52: error: invalid application of 'sizeof' to a function type
   93 |   unsigned ucontext_t_sz(void *ctx) { return sizeof(ucontext_t); }
      |                                                    ^~~~~~~~~~~~

```

Previously, `<sys/signal.h>` would include `<sys/ucontext.h>` due to a
XPG4v2 requirement. Now the latter needs to be included directly.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
…e ops (#198178)

if it is know that `trunc nuw to i1 ` can not be poison logical and/or
can be folded to bitwise ops.

proof https://alive2.llvm.org/ce/z/xQ2Sj-
Now that VP metadata has been cleaned up a little bit, we can reenable
this assertion.

Reviewers: alexander-shaposhnikov, mtrofin

Pull Request: #198141
#198203)

Extract the repeated edge-redirect + DomTree update pattern into a
RedirectEdge lambda, and convert the separate removeIncomingValue calls
for check blocks into a loop.
#198210)

Use ResumeForEpilogue to look up the vector trip count instead of plain
IR lookup. Also prepares for non-phi resume values.
With #196649 deduplicating VP
values and #193083 enforcing
this, we no longer need to worry about duplicate values, zero or
otherwise. Update the comment to reflect this.

Reviewers: mingmingl-llvm, teresajohnson

Reviewed By: mingmingl-llvm

Pull Request: #198140
…riate flags/pragmas (#187860)

Fixes #128239

The implementation adds warnings for floating-point exception function
calls (fenv.h) made without enabling floating-point exception behavior
via `-ffp-exception-behavior=maytrap/strict` or `#pragma STDC
FENV_ACCESS ON`. To support recognition of all fenv.h builtins,
`fexcept_t` and `fenv_t` were added as builtin types.
Add test cases showing functional change for
#194729.
…95269)

isMoreProfitable does not depend on anything in LoopVectorize.cpp, move
it to the recently added LoopVectorizationPlanner.cpp.

PR: #195269
Use Param.Threads (number of worker threads) as barrier threshold
instead of Param.UniqueThreads (boolean that controls input generation).

This also silences
[-Wbool-integral-comparison](#194180)
warning I'm working on.
This commit fixes `misc-static-initialization-cycle` crashing on `catch
(...)`.

Catch-all handlers have no exception declaration, so traversal of
`CXXCatchStmt` can call `TraverseDecl(nullptr)`. The check previously
passed that null pointer to `DeclContext::containsDecl`. This commit
fixes the problem by adding a null guard.

Closes #198150
@pull pull Bot locked and limited conversation to collaborators May 17, 2026
@pull pull Bot added the ⤵️ pull label May 17, 2026
@pull pull Bot merged commit 8f740a3 into optimizecompile:main May 17, 2026
6 of 7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.