561209 Commits

Author SHA1 Message Date
Louis Dionne
cd5ed7ca87
[libc++] Make CC and CXX environment variables mandatory in run-buildbot (#166875)
Previously, the bootstrapping-build job defined in run-buildbot required
the CC and CXX environment variables to be defined even though
run-buildbot documents these environment variables as being optional. It
also relied on ccache being available.

Refactor run-buildbot to make CC and CXX mandatory, and refactor various
places in the CI where we called run-buildbot without setting CC and
CXX. After this patch, all places that use run-buildbot are setting CC
and CXX before calling the script, which makes it easier to track what
compiler is used where. This also allows simplifying run-buildbot
itself.

Finally, this patch makes ccache optional for running the bootstrapping
build.
2025-12-02 08:58:00 -05:00
Bertik23
63f48fd829
[CFGPrinter] Add node id formater (#164623)
This PR is part of the LLVM IR LSP server project
([RFC](https://discourse.llvm.org/t/rfc-ir-visualization-with-vs-code-extension-using-an-lsp-server/87773))

Sometimes it is nice to be able to specify IDs of nodes in the printed
CFG. For better manipulation of the outputed CFG.
In our case we will use it for navigation between IR and CFG views.

This adds an argument to DOTFuncInfo - a function that takes a
BasicBlock and returns a node ID, to be printed in the result dot.
2025-12-02 05:48:18 -08:00
Alexandros Lamprineas
e88a83acde
[GlobalOpt][FMV] Perform expensive checks when NumVersions < Threshold (#168054)
Extends the static resolution algorith to handle cases where we can
infer additional information on why a prior caller version of higher
priority was skipped, based on the features of the current caller
version.

For example let's say the current caller is aes+sve2 and a previous
caller was mops+sve2. Knowing that sve2 is available we could deduce
that mops is unavailable. This would allow us to skip callee versions
which depend on mops.

This comes at the expense of performing more checks. However we can
control the threshold (number of versions) which decides whether the
expensive checks will be performed or not.
2025-12-02 13:46:39 +00:00
Igor Wodiany
b341885126
[mlir][spirv] (De)serialize Coherent decoration (#170280) 2025-12-02 08:42:18 -05:00
Nathan Gauër
e74b425ddc
[HLSL][SPIR-V] Add support for SV_Target semantic (#168743)
This PR adds the support for the SV_Target semantic and improved the
diagnostics when the stage is correct, but the direction is disallowed.

This PR will require #168735 to be merged first.
2025-12-02 13:19:00 +00:00
Aaron Ballman
c26fa8bfb9 Fix docs build
This amends 7e2411cd2b39625443bcf59be20e6636ba31ae8d
2025-12-02 08:16:42 -05:00
Felipe de Azevedo Piovezan
ac23264c03
Revert "[LLDB] Update Shell lit config to handle c8031c3dd743" (#170288)
Reverts llvm/llvm-project#170225

See failures in
https://ci.swift.org/view/all/job/llvm.org/job/as-lldb-cmake/36912/

```
[2025-12-02T01:20:37.083Z] # .---command stderr------------
[2025-12-02T01:20:37.083Z] # | clang: warning: no such sysroot directory: 'b/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' [-Wmissing-sysroot]
[2025-12-02T01:20:37.083Z] # | clang: warning: argument unused during compilation: '-fmodules-cache-path=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-clang/lldb-shell' [-Wunused-command-line-argument]
[2025-12-02T01:20:37.083Z] # | /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/test/Shell/Settings/Output/TestFrameFormatFunctionPrefix.test.tmp/main.m:2:13: warning: non-void function does not return a value [-Wreturn-type]
[2025-12-02T01:20:37.083Z] # |     2 | int func() {}
[2025-12-02T01:20:37.083Z] # |       |             ^
[2025-12-02T01:20:37.083Z] # | /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/test/Shell/Settings/Output/TestFrameFormatFunctionPrefix.test.tmp/main.m:3:21: warning: non-void function does not return a value [-Wreturn-type]
[2025-12-02T01:20:37.083Z] # |     3 | int bar() { func(); }
[2025-12-02T01:20:37.083Z] # |       |                     ^
[2025-12-02T01:20:37.083Z] # | 2 warnings generated.
[2025-12-02T01:20:37.083Z] # | ld: library 'System' not found
[2025-12-02T01:20:37.083Z] # | clang: error: linker command failed with exit code 1 (use -v to see invocation)
[2025-12-02T01:20:37.083Z] # `-----------------------------
[2025-12-02T01:20:37.083Z] # error: command failed with exit status: 1
```
2025-12-02 13:11:02 +00:00
Miko
7e2411cd2b
[clang][docs] Add link to C++ modules Wikipedia page to docs (#169200)
This PR adds a link to the "[Modules
(C++)](https://en.wikipedia.org/wiki/Modules_(C++))" page on Wikipedia
and similar on cpp reference, as per recommendation by another
contributor.
2025-12-02 13:04:42 +00:00
Akshiitaa06
4289849931
Improve formatting in BAT.md (#170254)
Make "Header" a subheading to improve readability in the Functions table
section.
2025-12-02 12:57:53 +00:00
Lewis Crawford
ea3fdc5972
Avoid maxnum(sNaN, x) optimizations / folds (#170181)
The behaviour of constant-folding `maxnum(sNaN, x)` and `minnum(sNaN,
x)` has become controversial, and there are ongoing discussions about
which behaviour we want to specify in the LLVM IR LangRef.

See:
  - https://github.com/llvm/llvm-project/issues/170082
  - https://github.com/llvm/llvm-project/pull/168838
  - https://github.com/llvm/llvm-project/pull/138451
  - https://github.com/llvm/llvm-project/pull/170067
-
https://discourse.llvm.org/t/rfc-a-consistent-set-of-semantics-for-the-floating-point-minimum-and-maximum-operations/89006

This patch removes optimizations and constant-folding support for
`maxnum(sNaN, x)` but keeps it folded/optimized for `qNaN`. This should
allow for some more flexibility so the implementation can conform to
either the old or new version of the semantics specified without any
changes.

As far as I am aware, optimizations involving constant `sNaN` should
generally be edge-cases that rarely occur, so here should hopefully be
very little real-world performance impact from disabling these
optimizations.
2025-12-02 12:43:03 +00:00
Anton Sidorenko
f5dd2dc712
[cmake] Fix semicolon expansion when passing LLVM_TABLEGEN_FLAGS (#169518)
This patch uses common workaround for cmake semicolon expansion to
spaces
2025-12-02 15:41:31 +03:00
Graham Hunter
0e6d6127d4
[AArch64] Improve select dagcombine (#169925)
An AnyOf reduction (aka vector.reduce.or) with a fixed-width vector is
canonicalized to a bitcast of the mask vector to an integer of the same
overall size, which is then compared against zero.

If the scalar result of the bitcast is smaller than the element size of
vectors being selected, we often end up with suboptimal codegen. This
fixes the main cases, removing scalarized code.
2025-12-02 12:29:49 +00:00
Valery Mironov
153c7e47d6
[libc++] Use private CMake flags to enable the pragma system_header macro when building (#138826)
That property doesn't need to be propagated beyond the translation units
of the libc++ built library itself.
2025-12-02 07:29:27 -05:00
Simon Pilgrim
7bced74576
[X86] combine-icmp.ll - fix copy+paste typo in concat_icmp_v64i8_v16i8 test (#170281)
I changed the condcode for variety but failed to update the constant to prevent constant folding
2025-12-02 12:05:59 +00:00
Ryotaro Kasuga
9ba5fa2e71
[Delinearization] Add test for inferred array size exceeds integer range (NFC) (#169048)
Add test cases where the delinearized arrays may not satisfy the
following "common" property:

`&A[I_1][I_2]...[I_n] == &A[J_1][J_2]...[J_n]` iff
`(I_1, I_2, ..., I_n) == (J_1, J_2, ..., J_n)`

The root cause of this issue is that the inferred array size is too
large and the offset calculation overflows.
Such results should be discarded during validation. This will be fixed
by #169902 .
2025-12-02 20:49:21 +09:00
daniilavdeev
3098bfe7d9
[llvm][Docs] Add release notes about dwarf fission with relaxations (#169871) 2025-12-02 14:47:17 +03:00
David Green
f741851731 Revert "[AArch64][ARM] Move ARM-specific InstCombine transforms into Transforms/Utils (#169589)"
This reverts commit 1c32b6f51ccaaf9c65be11d7dca9e5a476cddb5a due to failures on
BUILD_SHARED_LIBS builds.
2025-12-02 11:46:50 +00:00
Tibor Győri
e8bf011085
[LV] Emit better debug and opt-report messages when vectorization is disallowed in the LoopVectorizer (#158513)
While looking into fixing #158499, I found some other cases where the
messages emitted could be improved. This PR improves both the messages
printed to the debug output and the missed-optimization messages in
cases where:

- loop vectorization is explicitly disabled
- loop vectorization is implicitly disabled by disabling all loop
transformations
- loop vectorization is set to happen only where explicitly enabled

A branch that should currently be unreachable is also added. If the
related logic ever breaks (eg. due to changes to getForce() or the
ForceKind enum) this should alert devs and users. New test cases are
also added to verify that the correct messages (and only them) are
outputted.

---------

Co-authored-by: GYT <tiborgyri@gmail.com>
Co-authored-by: Florian Hahn <flo@fhahn.com>
2025-12-02 11:46:41 +00:00
Florian Hahn
4b6ad11876
[VPlan] Sink predicated stores with complementary masks. (#168771)
Extend the logic to hoist predicated loads
(https://github.com/llvm/llvm-project/pull/168373) to sink predicated
stores with complementary masks in a similar fashion.

The patch refactors some of the existing logic for legality checks to be
shared between hosting and sinking, and adds a new sinking transform on
top.

With respect to the legality checks, for sinking stores the code also
checks if there are any aliasing stores that may alias, not only loads.

PR: https://github.com/llvm/llvm-project/pull/168771
2025-12-02 11:43:37 +00:00
ArnavM3434
753f47d6a5
[X86] Make VBMI2 funnel shifts use VSHLD/VSHRD for const splats (#169401)
Make ISD::FSHL/FSHR legal on VBMI2 vector targets and convert to VSHLD/VSHRD in a combine

closes #166949
2025-12-02 11:40:01 +00:00
Martin Storsjö
458035027c [AArch64] [test] Make unwind info tests actually use the right instructions
This makes them match the expected decoding of the unwind info
opcodes, avoiding mismatch indications from "dumpbin -unwindinfo".
2025-12-02 13:33:51 +02:00
Martin Storsjö
4a619a7d08 [AArch64] [test] Spell out the matching instructions for SVE unwind opcodes
The MS dumpbin.exe tool can dump the unwind opcodes with the
"-unwindinfo" option; this mode also checks that the instructions
actually match the expected ones here. (This mode doesn't seem
to fully work for all instructions here, but spell out all the
intended instructions here.)
2025-12-02 13:33:50 +02:00
Martin Storsjö
9e27fefc18 [AArch64] [test] Fix stack allocation instructions in the seh.s test
The actual unwind opcodes only stores stack increments in units
of 16 (which is what it is listed as in the unwind opcode
dumping by llvm-readobj); actually write what we intend to encode.
2025-12-02 13:33:50 +02:00
Martin Storsjö
e50ac8a9b1 [AArch64] [test] Move tests for custom unwind opcodes to a separate function
These custom opcodes disable the checker for having the prologue
length actually match the opcodes (see checkARM64Instructions in
MCWin64EH.cpp) - which led to the prologue mismatching the opcodes
by one instruction, since 312d6b488ef9d7c0e4d649827820db7285e36406.

Move the special opcodes to a separate test function.

Remove the mismatched nop instruction at the end of the main
function, as this prologue now is assembled with the strict length
checking enabled.
2025-12-02 13:33:50 +02:00
Martin Storsjö
3e5b86cec1 [AArch64] [test] Write the seh.s test output object to a file
This is what is done in other tests; this makes it easier to
inspect the output of this test manually.
2025-12-02 13:33:50 +02:00
Paul Walker
aaa37afbc2
[LLVM][CodeGen][SVE] Add lowering for ISD::[ANY,SIGN,ZERO]_EXTEND_VECTOR_INREG. (#169847) 2025-12-02 11:31:52 +00:00
Arseniy Zaostrovnykh
c12dd598e2
[NFC][analyzer] Constify AnalysisConsumer::getModeForDecl (#170275)
In my previous commit I forgot that `this` argument of
AnalysisConsumer::getModeForDecl() is also never modified.
Here is the missing trailing const.
2025-12-02 11:30:31 +00:00
Martin Storsjö
4a0b5bc2b5
[MC] [Win64EH] Produce packed unwind for the special case of X19+LR (#169697) 2025-12-02 13:29:51 +02:00
valadaptive
1c32b6f51c
[AArch64][ARM] Move ARM-specific InstCombine transforms into Transforms/Utils (#169589)
Back when `TargetTransformInfo::instCombineIntrinsic` was added in
https://reviews.llvm.org/D81728, several transforms common to both ARM
and AArch64 were kept in the non-target-specific `InstCombineCalls.cpp`
so they could be shared between the two targets.

I want to extend the transform of the `tbl` intrinsics into static
`shufflevector`s in a similar manner to
https://github.com/llvm/llvm-project/pull/169110 (right now it only
works with a 64-bit `tbl1`, but `shufflevector` should allow it to work
with up to 2 operands, and it can definitely work with 128-bit vectors).
I think separating out the transform into a TTI hook is a prerequisite.

~~I'm not happy about creating an entirely new module for this and
having to wire it up through CMake and everything, but I'm not sure
about the alternatives. If any maintainers can think of a cleaner way of
doing this, I'm very open to it.~~

I've moved the transforms into
`Transforms/Utils/ARMCommonInstCombineIntrinsic.cpp`, which is a lot
simpler.
2025-12-02 11:17:12 +00:00
David Spickett
2f86bc207a
[clang] Only build c-index-test and apinotes-test when clang tests are included (#151157)
Those programs are only used for testing, and it's used in tests that
are already guarded by CLANG_INCLUDE_TESTS in clang/CMakeLists.txt.

This change enables us to do builds with
LLVM_INSTALL_TOOLCHAIN_ONLY=OFF, and CLANG_INCLUDE_TESTS=OFF, which
contain the required files to build other bits of llvm-project
standalone, but do not include those unnecessary testing programs.
2025-12-02 11:05:55 +00:00
David Spickett
d20d84fec5
[lldb] Make sure SBError is valid when SBDebugger::InitializeWithErrorHandling succeeds (#170156)
Fixes #169788

When this function fails to initialise the debugger, it sets the SBError
using the returned error from the initialise function. This results in
Success being false and isVaid being true. This is expected behaviour.

When it does not fail to initialise, it was returning the default
constructed SBError which has Success() == true but IsValid == false.
IsValid should be true, to show that the success can be trusted.

To fix this, construct the SBError using a default constructed Status,
which results in Success and IsValid being true.
2025-12-02 10:58:22 +00:00
Corentin Jabot
f01e8ac004
[Clang] Fix handling of zero-length arrays in sfinae context. (#170144)
We were producing a diagnostic for zero-length arrays in Sfinae context,
without invalidating the overload.

This causes the diagnostic to be emitted
if and when that undiagnosed overload is selected.

Fixes #170040
2025-12-02 11:55:43 +01:00
David Green
437fa02c07 [ARM] Add tests for over-sized mulh. NFC
The double-sized v8i32 do OK, but the larger v16i32 do not current get
converted to umulh.
2025-12-02 10:46:39 +00:00
Dan Blackwell
bbbc681463
[AArch64] Force dwarf unwind for MTE-tagged stack frames (#168530)
Currently, on Darwin running with -fsanitize=memtag-stack generates
compact-unwind exception unwinding that does not untag MTE-tagged memory
on the way back up.

This patch forces dwarf unwinding on MTE-tagged frames.

rdar://162195539
2025-12-02 10:34:04 +00:00
Martin Storsjö
535f604dab
[MC] [Win64EH] Clarify the comment about a skipped case of packed unwind info (#169784)
Clarify the comment from 924defada9bc0e3c89b0c0e288d7cb4dd654e7d4. There
is no longer any ambiguity about this case; newer versions of Windows
correctly match the documentation, making it clear that the older
versions were incorrect. Mention specific versions that have and don't
have the inconsistency.

Even if we wouldn't care about the older versions of Windows, we can't
enable this case of unwind info packing, unless the implementation also
is changed to match for asymmetrical prologs/epilogs.
2025-12-02 12:11:13 +02:00
Martin Storsjö
885509b1a2
[llvm-readobj] [ARMWinEH] Fix the interpretation of packed unwind CR=01 RegI=1 (#169676)
Even though the table for how to expand packed unwind info at [1]
doesn't explicitly say this, this case is mentioned at [2] under the
case "Only x19 saved":

    sub    sp,sp,#16                // reg save area allocation*
    stp    x19,lr,[sp]              // save x19, lr
    sub    sp,sp,#(framesz-16)      // allocate the remaining local area

This was discussed and clarified at [3].

[1]
https://learn.microsoft.com/en-us/cpp/build/arm64-exception-handling?view=msvc-170#packed-unwind-data
[2]
https://learn.microsoft.com/en-us/cpp/build/arm64-exception-handling?view=msvc-170#arm64-stack-frame-layout
[3]
https://github.com/llvm/llvm-project/issues/169588#issuecomment-3581688753
2025-12-02 12:07:49 +02:00
Marco Elver
96c69b7393
[LTO][AllocToken] Support AllocToken instrumentation in backend (#169358)
Unconditionally add AllocTokenPass to the optimization pipelines, and
ensure that it runs last in LTO backend pipelines. The latter ensures
that AllocToken instrumentation can be moved later in the LTO pipeline
to avoid interference with other optimizations (e.g. PGHO) and enable
late heap-allocation optimizations.

In preparation of removing AllocTokenPass being added by Clang, add
support for AllocTokenPass to read configuration options from LLVM
module flags.

To optimize given the pass is now runs unconditionally, only retrieve
TargetLibraryInfo and OptimizationRemarkEmitter when necessary.
2025-12-02 10:50:39 +01:00
Sven van Haastregt
0dec52b2c3
Fix NDEBUG Wundef warning; NFC (#170153)
The `NDEBUG` macro is tested for defined-ness everywhere else. The
instance here triggers a warning when compiling with `-Wundef`.
2025-12-02 10:24:11 +01:00
Jean-Didier PAILLEUX
b17e644eed
[flang/flang-rt] Adding support of RAND, IRAND and SRAND intrinsics (#166780)
This PR adds support of
[RAND](https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gfortran/RAND.html),
[IRAND](https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gfortran/IRAND.html)
and
[SRAND](https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gfortran/SRAND.html)
intrinsics in Flang, which are part of the GNU extension.
These intrinsics are used in the following benchmark:
[floatingspeed](https://github.com/ahbarnett/floatingspeed/)
2025-12-02 10:19:11 +01:00
Diana Picus
fa2ddf24e1
[AMDGPU] Fixup 30219f0f4300 (#170266) 2025-12-02 10:16:53 +01:00
Benjamin Maxwell
9107d09722
[AArch64][SME] Avoid clobbering X0 in the MachineSMEABIPass (#170131)
This tweaks `findStateChangeInsertionPoint` to also avoid clobbering X0,
which should be possible in most cases (since X0's live ranges are
likely to be very short before register allocation).

This improves codegen in a few cases, as not all redundant copies
to/from X0 are eliminated.
2025-12-02 09:16:30 +00:00
jeanPerier
a09571ed5b
[flang] represent ABSTRACT in fir.type_info (#170109)
This patch keeps information about ABSTRACT derived types and DEFERRED
type bound procedures inside fir.type_info dispatch tables.

This is part of the effort to delay generation of runtime type info
global by keeping the type information in a more condense fashion inside
fir.type_info (which is also easier to use for any potential
optimizations).
2025-12-02 10:13:23 +01:00
Robert Imschweiler
9605666949
Fix Windows OpenMP build (#170142)
fixes Windows build issue in
https://github.com/llvm/llvm-project/pull/168554
2025-12-02 09:54:36 +01:00
Henrich Lauko
04dd71cb0b
[CIR] Align inline-kind FuncOp attribute with incubator (#170050)
Switches to more efficient explicit enum property instead of a wrapped
storage, simplifying the string representation. The attribute is now
placed before the symbol name for consistency with other FuncOp
attributes. FileCheck patterns are also simplified to match only the
attributes under test.
2025-12-02 09:53:50 +01:00
Cullen Rhodes
b76815218a
Revert "[Attributor] Support nested conditional branches" (#170257)
Reverts llvm/llvm-project#168532

Causing a crash in the flang-rt that needs to be investigated, see
#170211.
2025-12-02 08:45:33 +00:00
Diana Picus
30219f0f43
[AMDGPU] Allow any SGPRs for chain callees (#168345)
Chain calls never return and don't need to preserve any SGPRs.
Therefore, we don't need to limit the registers used for callees to the
CCR_SGPR_64 register class - it's fine to use any available SGPRs.

Also introduce a new pseudo, SI_TCRETURN_CHAIN, which also has a plain
SGPR_64 operand. This is necessary because we won't be able to lower
SI_CS_CHAIN_TC to SI_TCRETURN anymore, since its operand accepts a wider
range of registers than the latter.
2025-12-02 09:44:35 +01:00
Vladi Krapp
34c699246d
[Arm] Control forced unrolling of small loops (#170127)
* Add flag to control cost threshold for forced unrolling of loops.
  Existing value preserved as default.
2025-12-02 08:39:26 +00:00
Sameer Sahasrabuddhe
2024d6732b [NFC][AMDGPU] modify lit test to use update_llc_test_checks 2025-12-02 13:51:26 +05:30
Fangrui Song
87d37956b3
[lld-macho] Remove cuIndices indirection in UnwindInfoSection. NFC (#170252)
cuEntries was sorted indirectly through a separate `cuIndices`.
Eliminate cuIndices for simplicity.

Linking chromium_framework from `#48001` with `-no_uuid` gives identical
executable using this patch.
2025-12-02 00:18:09 -08:00
Nathan Corbyn
b5f7058e91
[AArch64][GlobalISel] Don't crash when legalising vector G_SHL (#168848) 2025-12-02 07:57:47 +00:00