12268 Commits

Author SHA1 Message Date
Sam Elliott
0d08cb0e70
[outliners] Turn nooutline into an Enum Attribute (#163665)
This change turns the `"nooutline"` attribute into an enum attribute
called `nooutline`, and adds an auto-upgrader for bitcode to make the
same change to existing IR.

This IR attribute disables both the Machine Outliner (enabled at Oz for
some targets), and the IR Outliner (disabled by default).
2026-02-10 21:44:17 -08:00
Sameer Sahasrabuddhe
b02b395a1e
[AMDGPU] Asynchronous loads from global/buffer to LDS on pre-GFX12 (#180466)
The existing "LDS DMA" builtins/intrinsics copy data from global/buffer
pointer to LDS. These are now augmented with their ".async" version,
where the compiler does not automatically track completion. The
completion is now tracked using explicit mark/wait intrinsics, which
must be inserted by the user. This makes it possible to write programs
with efficient waits in software pipeline loops. The program can now
wait for only the oldest outstanding operations to finish, while
launching more operations for later use.

This change only contains the new names of the builtins/intrinsics,
which continue to behave exactly like their non-async counterparts. A
later change will implement the actual mark/wait semantics in
SIInsertWaitcnts.

This is part of a stack split out from #173259:
- #180467
- #180466

Fixes: SWDEV-521121
2026-02-11 05:26:58 +00:00
Yingwei Zheng
36caa31621
[llubi] Add UTC helper (#180603)
This patch adds a UTC helper `llvm/utils/update_llubi_test_checks.py` to
generate check lines for the trace. Generalizer and multiple prefixes
are not supported since they are meaningless for traces. I know it is a
bit weird, but I don't have a better idea :(

I found that `llvm/utils/update_test_body.py` also works. But it is
annoying to duplicate the command twice.
2026-02-11 11:22:43 +08:00
Reid Kleckner
246f18778e [docs] Move Maintainers.rst to Maintainers.md in preparation to reformat
This change intentionally produces malformatted documentation, and is
only present to ensure git detects the file rename for blame purposes.
2026-02-10 23:13:56 +00:00
Yingwei Zheng
a29f0dd096
[llubi] Add initial support for llubi (#180022)
This patch implements the initial support for upstreaming
[llubi](https://github.com/dtcxzyw/llvm-ub-aware-interpreter). It only
provides the minimal functionality to run a simple main function. I hope
we can focus on the interface design in this PR, rather than trivial
implementations for each instruction.
RFC link:
https://discourse.llvm.org/t/rfc-upstreaming-llvm-ub-aware-interpreter/89645

Excluding the driver `llubi.cpp`, this patch contains three components
for better decoupling:
+ `Value.h/cpp`: Value representation
+ `Context.h/cpp`: Global state management (e.g., memory) and
interpreter configuration
+ `Interpreter.cpp`: The main interpreter loop

Compared to the out-of-tree version, the major differences are listed
below:
+ The interpreter logic always returns the control to its caller, i.e.,
it never calls `exit/abort` when immediate UBs are triggered.
+ `EventHandler` provides an interface to dump the trace. It also allows
callers to inspect the actual value and verify the correctness of
analysis passes (e.g, KnownBits/SCEV).
+ The context is designed to be reentrant. That is, you can call
`runFunction` multiple times. But its usefulness remains in doubt due to
side effects made by previous calls.
+ `runFunction` handles function calls with a loop, instead of calling
itself recursively. This makes it no longer bounded by the stack depth.
+ Uninitialized memory is planned to be approximated by returning random
values each time an uninitialized byte is loaded.
2026-02-10 01:54:34 +08:00
Pierre van Houtryve
b79ba02479
[AMDGPU][GFX12.5] Reimplement monitor load as an atomic operation (#177343)
Load monitor operations make more sense as atomic operations, as
non-atomic operations cannot be used for inter-thread communication w/o
additional synchronization.
The previous built-in made it work because one could just override the
CPol bits, but that bypasses the memory model and forces the user to learn
about ISA bits encoding.

Making load monitor an atomic operation has a couple of advantages.
First, the memory model foundation for it is stronger. We just lean on the
existing rules for atomic operations. Second, the CPol bits are abstracted away
from the user, which avoids leaking ISA details into the API.

This patch also adds supporting memory model and intrinsics
documentation to AMDGPUUsage.

Solves SWDEV-516398.
2026-02-09 09:57:27 +01:00
Pengcheng Wang
151fadecd1
[RISCV][MC] Support experimental Zvabd instructions
The `Zvabd` is for `RISC-V Integer Vector Absolute Difference` and
it provides 5 instructions:

* `vabs.v`: Vector Signed Integer Absolute.
* `vabd.vv`: Vector Signed Integer Absolute Difference.
* `vabdu.vv`: Vector Unsigned Integer Absolute Difference.
* `vwabda.vv`: Vector Signed Integer Absolute Difference And Accumulate.
* `vwabdau.vv`: Vector Unsigned Integer Absolute Difference And Accumulate.

Doc: https://github.com/riscv/integer-vector-absolute-difference

Reviewers: topperc, lukel97, preames, tclin914, asb, kito-cheng, mshockwave

Pull Request: https://github.com/llvm/llvm-project/pull/180139
2026-02-09 14:18:39 +08:00
Nicolas IOOSS
c25018bb4d
[Docs][Intrisics] Fix the name of llvm.memset.inline in the documentation (#180373)
LLVM intrinsic `llvm.memset.inline` indicates in its name the types of
the destination pointer and the size. There is no second pointer.

Moreover, the tests are already verifying that generated code uses
`@llvm.memset.inline.p0.i32` and `@llvm.memset.inline.p0.i64`. So make
the documentation reference these names as well.

Fixes: https://github.com/llvm/llvm-project/issues/163454
2026-02-08 22:31:53 +01:00
Vladimir Vereschaka
19d681177f
Revert "[MC][TableGen] Expand Opcode field of MCInstrDesc" (#180321)
Reverts llvm/llvm-project#179652

This PR causes the out-of-memory build failures on many Windows
builders.
2026-02-06 21:58:50 -08:00
Peter Collingbourne
191af6c254
Add llvm.cond.loop intrinsic.
The llvm.cond.loop intrinsic is semantically equivalent to a conditional
branch conditioned on ``pred`` to a basic block consisting only of an
unconditional branch to itself. Unlike such a branch, it is guaranteed
to use specific instructions. This allows an interrupt handler or
other introspection mechanism to straightforwardly detect whether
the program is currently spinning in the infinite loop and possibly
terminate the program if so. The intent is that this intrinsic may
be used as a more efficient alternative to a conditional branch to
a call to ``llvm.trap`` in circumstances where the loop detection
is guaranteed to be present. This construct has been experimentally
determined to be executed more efficiently (when the branch is not taken)
than a conditional branch to a trap instruction on AMD and older Intel
microarchitectures, and is also more code size efficient by avoiding the
need to emit a trap instruction and possibly a long branch instruction.

On i386 and x86_64, the infinite loop is guaranteed to consist of a short
conditional branch instruction that branches to itself. Specifically,
the first byte of the instruction will be between 0x70 and 0x7F, and
the second byte will be 0xFE.

Part of this RFC:
https://discourse.llvm.org/t/rfc-optimizing-conditional-traps/89456

Reviewers: arsenm, RKSimon, fmayer, vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/177686
2026-02-06 17:11:15 -08:00
Derek Schuff
52eb82e4f9
[objcopy][Wasm] Make strip-all remove all non-engine-interpreted sections (#180246)
Currently the default strip-all behavior is to remove sections known
to LLVM but leave others. Now that the standard specifies the section
name
"metadata.code.*" as used for compiler annotations interpreted by Wasm
engines, we can more confidently give strip its more conventional
behavior
of removing everything that won't be used by the engine.
2026-02-06 12:39:45 -08:00
sstipano
13d8870d45
[MC][TableGen] Expand Opcode field of MCInstrDesc (#179652)
Increase width of Opcode to `int` from `short` to allow more capacity.
2026-02-06 20:21:48 +01:00
Prabhu Rajasekaran
5efb69f7c3
[NFC][llvm][docs] Fix alphabetical order of commands (#178519)
Fix the order of commands for llvm-readelf and llvm-readobj docs.
2026-02-06 18:06:10 +00:00
Minsoo Choo
bc706338c1
[lldb] [Process/FreeBSD] Assume minimum is FreeBSD 14 (#179587)
Currently versions under 13 are EOLed (see [FreeBSD Release
Information](https://www.freebsd.org/releases/)).

FreeBSD 13 will be EOLed by April 30th (see [Supported FreeBSD
releases](https://www.freebsd.org/security/#sup)) while LLVM 23 is
expected to be released in August 25th according to the LLVM calendar.

Thus assumed that minimum supported FreeBSD version is 14.

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
2026-02-06 08:59:46 -05:00
Mirko Brkušanin
20b5849e17
[AMDGPU] Define new target gfx1170 (#180185) 2026-02-06 14:38:50 +01:00
Jonas Devlieghere
7bef2cdec6
[llvm] Update policy for Doxygen comments in the Coding Standards (#179898)
This PR updates the policy regarding Doxygen comments in the Coding
Standards based on an RFC discussion on Discourse:

https://discourse.llvm.org/t/rfc-policy-for-doxygen-comments-in-lldb/89675/
2026-02-06 09:12:00 +01:00
paperchalice
d289020a10
[LangRef] Correct uitofp example (#180123)
The to type is incorrect, use `float` instead.
2026-02-06 14:04:23 +08:00
Min-Yih Hsu
6441f1c9d5
[RISCV] Introduce a new syntax for processor-specific tuning feature strings (#175063)
This patch proposes new a tuning feature string format that helps users
to build a performance model by "configuring" an existing tune CPU,
along with its scheduling model. For example, this string
```
"sifive-x280:single-element-vec-fp64"
```
takes ``sifive-x280`` as the "base" tune CPU and configured it with
``single-element-vec-fp64``. This gives us a performance model that
looks exactly like that of ``sifive-x280``, except some of the 64-bit
vector floating point instructions now produce only a single element per
cycle due to ``single-element-vec-fp64``.

This string could eventually be used in places like ``-mtune`` at the
frontend. Right now, this patch only implements the parser part, which
is put under the TargetParser library.

The grammar for this string is:
```
    tune-cpu      ::= 'tuning CPU name in lower case'
    directive     ::= "[a-zA-Z0-9_-]+"
    tune-features ::= directive ["," directive]*
```
A *directive* can and can only _enable_ or _disable_ a certain tuning
feature from the tuning CPU. A **positive directive**, like the
``single-element-vec-fp64`` we just saw, enables an additional tuning
feature in the associated tuning model.

A **negative directive**, on the other hand, removes a certain tuning
feature. For example, ``sifive-x390`` already has the
``single-element-vec-fp64`` feature, and we can use
"sifive-x390:no-single-element-vec-fp64" to create a new performance
model that looks nearly the same as ``sifive-x390`` except
``single-element-vec-fp64`` being cut out. In this case,
``no-single-element-vec-fp64`` is a negative directive.

There are additional restrictions on what we can put in the list of
directives, please refer to the documentations for more details.

Right now, this string only accepts directives that are explicitly
supported by the tune CPU. For example, "sifive-x280:prefer-w-inst" is
not a valide string as ``prefer-w-inst`` is not supported by
``sifive-x280`` at this moment. Vendors of these processors are expected
to maintain the compatibility of their supported directives across
different versions.

---------

Co-authored-by: Sam Elliott <aelliott@qti.qualcomm.com>
2026-02-05 15:22:07 -08:00
Minsoo Choo
427bb1cc1b
[lldb] Remove mips64 support for FreeBSD (#179582)
The last FreeBSD version supporting mips64 is FreeBSD 13 which will be
EOLed on April 30th. LLVM 23.1.0 release is expected to be August 25th
according to the LLVM calendar. The usage of mips64 is less noticeable
so it's hard to know if it is properly working, and even if it works, it
is hard to test new features on FreeBSD mips64.

Thus, remove support for mips64 on FreeBSD.

---------

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
2026-02-05 15:07:27 +00:00
Matt Arsenault
2502e3b7ba
IR: Promote "denormal-fp-math" to a first class attribute (#174293)
Convert "denormal-fp-math" and "denormal-fp-math-f32" into a first
class denormal_fpenv attribute. Previously the query for the effective
denormal mode involved two string attribute queries with parsing. I'm
introducing more uses of this, so it makes sense to convert this
to a more efficient encoding. The old representation was also awkward
since it was split across two separate attributes. The new encoding
just stores the default and float modes as bitfields, largely avoiding
the need to consider if the other mode is set.

The syntax in the common cases looks like this:
  `denormal_fpenv(preservesign,preservesign)`
  `denormal_fpenv(float: preservesign,preservesign)`
  `denormal_fpenv(dynamic,dynamic float: preservesign,preservesign)`

I wasn't sure about reusing the float type name instead of adding a
new keyword. It's parsed as a type but only accepts float. I'm also
debating switching the name to subnormal to match the current
preferred IEEE terminology (also used by nofpclass and other
contexts).

This has a behavior change when using the command flag debug
options to set the denormal mode. The behavior of the flag
ignored functions with an explicit attribute set, per
the default and f32 version. Now that these are one attribute,
the flag logic can't distinguish which of the two components
were explicitly set on the function. Only one test appeared to
rely on this behavior, so I just avoided using the flags in it.

This also does not perform all the code cleanups this enables.
In particular the attributor handling could be cleaned up.

I also guessed at how to support this in MLIR. I followed
MemoryEffects as a reference; it appears bitfields are expanded
into arguments to attributes, so the representation there is
a bit uglier with the 2 2-element fields flattened into 4 arguments.
2026-02-05 13:31:26 +00:00
Jay Foad
7ea33e6848
[CodeGen] Remove unused first operand of SUBREG_TO_REG (#179690)
The first input operand of SUBREG_TO_REG was an immediate that most
targets set to 0. In practice it had no effect on codegen. Remove it.
2026-02-04 17:35:21 +00:00
Kito Cheng
466c22ba47
[RISCV] Make MOP/HINT-based instruction mnemonics always available (#178609)
Per the psABI discussion in riscv-non-isa/riscv-elf-psabi-doc#474, the
conclusion was to NOT introduce a new build attribute for MOP/HINT
encoding reinterpretation. Instead, the toolchain should recognize these
mnemonics unconditionally in the assembler and disassembler.

The rationale is that these encodings occupy reserved hint/MOP space
that is architecturally guaranteed not to trap on any compliant
implementation. Requiring explicit extension flags creates unnecessary
friction for users who simply want to write or read these instructions,
while providing no real safety benefit since the encodings are always
valid.

Note: Ideally, the ISA specification would explicitly guarantee that
these MOP/HINT encodings will never be reassigned to conflicting
instructions. However, the ISA architects prefer to preserve flexibility
in this area rather than making such guarantees in the spec. Given the
practical reality that reassignment is highly unlikely, the toolchain
takes the pragmatic approach of always recognizing these mnemonics.

This change makes the following mnemonics always available:
- lpad (Zicfilp): AUIPC hint encoding, always valid
- pause (Zihintpause): FENCE hint encoding, always valid
- ntl.* (Zihintntl): ADD hint encoding, always valid
- c.ntl.* (Zihintntl+C): requires C extension only
- sspush/sspopchk/ssrdp (Zicfiss): requires Zimop only (MOP encoding)
- c.sspush/c.sspopchk (Zicfiss+Zcmop): requires Zcmop only

Note: ssamoswap.w/d still requires Zicfiss as they use AMO encoding
space rather than MOP encoding.

Codegen patterns remain unchanged in this patch - generating these
instructions in the compiler backend still requires the full extension
to be enabled. A follow-up patch will relax this restriction as well,
since these instructions are fundamentally MOP/HINT encodings that
should be safe to generate regardless of extension availability.

Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/474
2026-02-03 23:39:53 +08:00
guohaonan
584bd38627
[docs] fix output question (#177842)
See the code:
<img width="2631" height="1090" alt="image"
src="https://github.com/user-attachments/assets/dfe949b3-fbc6-4cd3-9e8d-5c0adbfcc67a"
/>
<img width="1751" height="577" alt="image"
src="https://github.com/user-attachments/assets/e3b78596-24b9-4bd5-b40d-a4154b2e6bb2"
/>


So the output is not the number, is the text "__anon_expr".
2026-02-01 09:37:48 +00:00
Peter Collingbourne
d4c9969bfd DebuggingLLVM: Bazel 9 is released. 2026-01-30 10:43:28 -08:00
Ben Dunbobbin
88478ab495
[DOC][DTLTO] Update DTLTO documentation for the LLVM 22 release (#177368)
This change updates the documentation to reflect work completed during
the LLVM 22 timeframe, including support for the ThinLTO cache and
static libraries/archives.

It also clarifies that the goal of DTLTO is to support distribution of
ThinLTO backend compilations for any in-process ThinLTO invocation.

SIE Internal Tracker: TOOLCHAIN-21016
2026-01-30 16:17:20 +00:00
Aaditya
e9e8b38c80
[AMDGPU] Update documentation for wave reduction intrinsics (#175132) 2026-01-30 18:19:40 +05:30
hev
4953ebf386
[LoongArch] Support preserve_none calling convention (#178566)
Add support for the `preserve_none` calling convention on LoongArch.
Registers `R4-R20` and `R23-R31` are treated as caller-saved and may be
used for argument passing, except for `R31`.
2026-01-30 09:49:17 +08:00
Viktoria Maximova
8f8dfbf8c9
[SPIR-V] Implement SPV_KHR_fma extension (#173057)
The extension adds support for the `OpFmaKHR` instruction, which
provides a native SPIR-V instruction for fused multiply-add operations
as an alternative to using OpenCL.std::Fma extended instruction.

Translate both LLVM fma intrinsics as well as OCL builtins to `OpFmaKHR`
if the extension is available.

Specification:

https://github.khronos.org/SPIRV-Registry/extensions/KHR/SPV_KHR_fma.html
2026-01-29 17:39:57 -08:00
Peter Collingbourne
e6429d6e93 Add the backend flags to DebuggingLLVM. 2026-01-29 16:22:42 -08:00
Craig Topper
3e68df04da
[RISCV] Update P extension to 019. (#178031)
This renames two scalar instructions to not start with P. P means
"packed".
2026-01-28 10:20:54 -08:00
Jay Foad
9e75d690c2
[FileCheck] Allow -check-prefix to take multiple prefixes (#178187)
There was no real benefit to disallowing this, and it sometimes caused
unnecessary churn in the RUN lines of tests which were updated from
single-to-multiple or multiple-to-single prefixes.

This effectively makes -check-prefixes the primary option and
-check-prefix just an alias of it. The documentation is upated
accordingly.
2026-01-28 13:26:09 +00:00
Lucas Chollet
774279f012
[llvm-cov] Introduce -include-filename-regex (#175779)
This allows to filter the source directory so the coverage outputs only includes the files matching the regex.
2026-01-27 12:41:47 -06:00
Kristof Beyls
7687a14e6f [docs] Update ics for my office hours 2026-01-27 10:20:44 +01:00
Matt Arsenault
a7d48bd305
DAG: Remove TypePromoteFloat (#177427)
Remove the now unimplemented target hook and associated DAG machinery
for the old half legalization path.

Really fixes #97975
2026-01-26 22:02:24 +00:00
Mark Zhuang
a53daac6f6
[RISCV] Add Spacemit X100 processor definition (#173988)
SpacemiT X100 is a 4-issue, out-of-order, RVA23 processor

https://www.spacemit.com/en/spacemit-x100-core/
2026-01-26 15:24:56 +08:00
Thurston Dang
f45c8ba0cd
[RISC-V][sanitizers][NFCI] Add documentation on which sanitizers probably work (#177679)
Docs requested in https://github.com/llvm/llvm-project/issues/172375
2026-01-23 14:37:17 -08:00
Sam Elliott
5b4a5cf51f
[RISCV][llvm-objdump] Support --symbolize-operands (#166656)
This adds support for `--symbolize-operands`, so that local references
are turned back into labels by objdump, which makes it easier to tell
what is going on with a linked object.

When using `--symbolize-operands`, branch target addresses are not
printed, only the referenced symbol is printed, and the address is
elided:

```
# Without --symbolize-operands
       0: 04a05263      blez    a0, 0x44 <.text+0x44>
...
      40: fd1ff06f      j       0x10 <.text+0x10>
      44: 00000613      li      a2, 0x0

# With --symbolize-operands
       0: 04a05263      blez    a0,  <L3>
...
      40: fd1ff06f      j        <L0>
<L3>:
      44: 00000613      li      a2, 0x0
```
2026-01-23 09:42:43 -08:00
Nikita Popov
afec4c28d5
[LangRef] Normalize IEEE 754 spelling (#174721)
We currently use three spellings, "IEEE754", "IEEE-754" and "IEEE 754".
Normalize to the latter.
2026-01-23 15:33:44 +01:00
Nikita Popov
6bae2a98b4
[LangRef] Clarify specification for float min/max operations (#172012)
This implements some clarifications for the specification of floating
point min/max operations based on the discussion in
https://discourse.llvm.org/t/rfc-a-consistent-set-of-semantics-for-the-floating-point-minimum-and-maximum-operations/89006.

The key changes are:

* Explicitly specify minnum and maxnum with an sNaN operand as
non-deterministically either returning NaN or treating sNaN as qNaN.
This was implied by our general NaN semantics, but is important to call
out here due to the special behavior of sNaN.
* Explicitly specify the same non-determinism for the minnum/maxnum
based vector reductions as well.
* Explicitly specify the meaning of nsz on float min/max ops. In
particular, clarify that unlike normal nsz semantics, it does not allow
introducing a zero with a different sign out of thin air.
* Simplify the semantics comparison section. This now focuses only on
NaN and signed zero behavior, but omits information about exceptions
that is not relevant for these non-constrained intrinsics.
2026-01-23 14:35:32 +01:00
Raul Tambre
84b2f120f3
[MC][X86/M68k] Emit syntax directive for AT&T (#167234)
This eases interoperability by making it explicit in emitted assembly code which syntax is used.
Refactored to remove X86-specific directives and logic from the generic MC(Asm)Streamer.

Motivated by building LLVM with `-mllvm -x86-asm-syntax=intel` (i.e. a global preference for Intel
syntax). A Bolt test (`runtime/X86/fdata-escape-chars.ll`) was using `llc` to compile to assembly
and then assembling with `clang`. The specific option causes Clang to assume Intel syntax but only
for assembly and not inline assembly.
2026-01-23 10:46:02 +02:00
valadaptive
3781a08e3e
[LangRef] Clarify semantics of undef in shufflevector masks (#171453)
The current phrasing of `shufflevector` in the language reference
states:

> A poison element in the mask vector specifies that the resulting
element is poison. For backwards-compatibility reasons, LLVM temporarily
also accepts undef mask elements, which will be interpreted the same way
as poison elements.

This is a bit ambiguous. Does it mean that an undef mask element
produces a poison result element, or an undef result element?

Per https://reviews.llvm.org/D148637, the answer is the former. I've
updated the docs to make this explicit.

As part of the same paragraph, the language reference also currently
states:

> If the shuffle mask selects an undef element from one of the input
vectors, the resulting element is undef.

When I first skimmed this, I thought it meant that an undef *mask
element* resulted in an undef result element. However, it's actually
talking about undef *input elements*. That's easy to miss, since the
rest of the paragraph discusses mask elements. I've moved that sentence
to its own paragraph to make things less confusing.
2026-01-23 00:52:48 -05:00
Matt Arsenault
6934ed51b3
IR: Add !nofpclass metadata (#177140)
This adds the analogous metadata to the nofpclass attribute
to assert values are not a certain set of floating-point classes.
This allows the same information to be expressed if a function
argument is passed indirectly. This matches the bitmask encoding
of nofpclass.

I also think this should be allowed for stores to symmetrically handle
sret, but leave that for later.

Alternatively we could add a more expressive !fprange metadata,
but that would be much more complex. It's useful to match the attribute,
and more annotations can always be added.

Fixes #133560
2026-01-22 20:49:34 +01:00
Justin Fargnoli
9fc5fd0ad6
[NVPTX] Update the default SM to 7.5 (#176021)
Update NVPTX's default SM to sm_75. This matches the behavior of offline
compilation tools in the CUDA Toolkit (nvcc, ptxas, ...)
2026-01-22 18:26:55 +00:00
Mariusz Sikora
6de6f7b46b
[AMDGPU] Define gfx1310 target with ELF number 0x50 (#177355)
For now this is identical to gfx1250.

---------

Co-authored-by: Jay Foad <jay.foad@amd.com>
2026-01-22 17:08:38 +01:00
Liao Chunyu
a43b55edf4
[RISCV]Remove experimental from Zalasr (#177120)
Zalasr 1.0 was ratified in October 2025.

Documentation:https://docs.riscv.org/reference/isa/extensions/zalasr/_attachments/riscv-zalasr.pdf
2026-01-22 17:30:38 +08:00
Aiden Grossman
e2d7cd685d
[IR] Make dead_on_return attribute optionally sized
This patch makes the dead_on_return parameter attribute optionally require a number
of bytes to be passed in to specify the number of bytes known to be dead
upon function return/unwind. This is aimed at enabling annotating the
this pointer in C++ destructors with dead_on_return in clang. We need
this to handle cases like the following:

```
struct X {
  int n;
  ~X() {
    this[n].n = 0;
  }
};
void f() {
  X xs[] = {42, -1};
}
```

Where we only certain that sizeof(X) bytes are dead upon return of ~X.
Otherwise DSE would be able to eliminate the store in ~X which would not
be correct.

This patch only does the wiring within IR. Future patches will make
clang emit correct sizing information and update DSE to only delete
stores to objects marked dead_on_return that are provably in bounds of
the number of bytes specified to be dead_on_return.

Reviewers: nikic, alinas, antoniofrighetto

Pull Request: https://github.com/llvm/llvm-project/pull/171712
2026-01-21 08:22:05 -08:00
Nathan Gauër
9247e89706
[IR] Add llvm.structured.gep instruction (#176145)
This commit adds initial support for `@llvm.structured.gep` instruction
in Clang. This intrinsic is supposed to be used as an alternative to
ptrdiff/GEP when pointers arithmetic is invalid and only structured
access is possible.

Link to the RFC:

https://discourse.llvm.org/t/rfc-adding-instructions-to-to-carry-gep-type-traversal-information/
Previous discussion around the documentation:
  https://github.com/llvm/llvm-project/pull/167883
2026-01-21 15:45:08 +00:00
Pierre van Houtryve
3dda4b5463
[Doc][AMDGPU] Add barrier execution & memory model (#170447)
Add a formal execution model, and a memory model for the execution barrier
primitives available in GFX12.0 and below.
The model also works for GFX12.5 workgroup/workgroup trap barriers, but does
not include the new barrier types and instructions added in GFX12.5.
These will be added at a later date.
2026-01-21 16:12:33 +01:00
unexpectedlydefined
df063cbf11
[llvm-dwarfdump][LineCov 1/3] Add variable coverage metrics (#176725)
Patch 1 of 3 to add to llvm-dwarfdump the ability to measure DWARF
coverage of local variables in terms of source lines, as discussed in
[this
RFC](https://discourse.llvm.org/t/rfc-debug-info-coverage-tool-v2/83266).

This patch adds the basic variable coverage implementation. By default,
inlined instances are shown separately (displaying the full inlining
chain). Alternatively, a combined view that averages across all inlined
instances can be returned using `--combine-instances`.

In this patch, we simply print a count of source lines over which each
variable is covered. Later patches in the series will add the comparison
against a baseline.

Example output:
```
$ llvm-dwarfdump --show-variable-coverage somefile
Variable coverage statistics:
Function InlChain                   Variable Decl                  LinesCovered
foo                                 bar      path/to/somefile.h:54 3
foo      path/to/someotherfile.c:32 bar      path/to/somefile.h:54 2
foo                                 baz      main.c:76             9
```

```
$ llvm-dwarfdump --show-variable-coverage somefile --combine-instances
Variable coverage statistics:
Function InstanceCount Variable Decl                  LinesCovered
foo      2             bar      path/to/somefile.h:54 2.5
foo      1             baz      main.c:76             9
```

This reapplies #169646, fixing some ambiguous overloads that caused
several bots to fail.
2026-01-21 13:22:23 +00:00
Luke Lau
cee36b23cc
[IR] Allow non-constant offsets in @llvm.vector.splice.{left,right} (#174693)
Following on from #170796, this PR implements the second part of
https://discourse.llvm.org/t/rfc-allow-non-constant-offsets-in-llvm-vector-splice/88974
by allowing non-constant offsets in the vector splice intrinsics.

Previously @llvm.vector.splice had a restriction enforced by the
verifier that the offset had to be known to be within the range of the
vector at compile time. Because we can't enforce this with non-constant
offsets, it's been relaxed so that offsets that would slide the vector
out of bounds return a poison value, similar to
insertelement/extractelement.

@llvm.vector.splice.left also previously only allowed offsets within the
range 0 <= Offset < N, but this has been relaxed to 0 <= Offset <= N so
that it's consistent with @llvm.vector.splice.right.

In lieu of the verifier checks that were removed, InstSimplify has been
taught to fold splices to poison when the offset is out of bounds.

The cost model isn't implemented in this PR, and just returns invalid
for any non-constant offsets for now. I think the correct way to cost
these non-constant offets isn't through getShuffleCost because they
can't handle variable masks, but instead just through
getIntrinsicInstCost.
2026-01-21 10:58:40 +00:00