565532 Commits

Author SHA1 Message Date
Susan Tan (ス-ザン タン)
7364ff56bc
[acc] acc declare + present clause for COMMON blocks (#175588)
Fix: `!$acc declare present(/COMMON/)` no longer adds
`acc.declare(dataClause=acc_present)` attribute to the fir.global
common.

Lowering change: COMMON+present is lowered through the structured
declare path (fir.address_of + acc.present operand) to preserve scope.
2026-01-15 18:30:38 +00:00
Benjamin Lerman
a72958a95d
[AArch64] Use a load instead of a store for inline stack probes (#170855)
Frequently, when big buffers are put on the stack we end up
with multiple virtual pages Copy-On-Write mapped to single physical zero page.
Stack probes would unnecessarily trigger a Copy-On-Write on such pages. Avoid this
by using loads into the XZR.
2026-01-15 18:00:24 +00:00
Matt Arsenault
b29ee6ed4b
InstCombine: Fix SimplifyDemandedFPClass for fadd with known-inf source
(#176204)

Ensure the result cannot be nan.

Split out from https://github.com/llvm/llvm-project/pull/175852
2026-01-15 17:54:53 +00:00
Szymon Sobieszek
5dccab0272
[LoopFusion] Removing dead code leftover after PR #171889 (NFC) (#176020)
Removed unused functions in order to fix 'unused function' warnings, as
mentioned in PR 171889. This involved the two original functions
```ControlConditions::isEquivalent(const ControlConditions &Other)
const``` and ```ControlConditions::collectControlConditions(const
llvm::BasicBlock&, const llvm::BasicBlock&, const llvm::DominatorTree&,
const llvm::PostDominatorTree&, unsigned int)``` plus all the functions
that became unused as the result of deleting the two original ones.

Co-authored-by: Szymon Sobieszek <szymon.sobieszek1@huawei.com>
2026-01-15 12:53:35 -05:00
Simon Pilgrim
1eb52793e6
[X86] combineConcatVectorOps - add X86ISD::PCLMULQDQ handling for VPCLMULQDQ targets (#176203) 2026-01-15 17:50:40 +00:00
Max
eb82ddc53a
[clang][-Wunsafe-buffer-usage] Ignore consteval functions (#171503)
We dont need to visit or warn on consteval functions as they can't have
UB.

---------

Co-authored-by: mxms <mxms@google.com>
2026-01-15 12:42:05 -05:00
Craig Topper
08de4fd0d4
[SelectionDAG] Move HwMode expansion from tablegen to SelectionISel. (#174471)
The way HwMode is currently implemented, tablegen duplicates each
pattern that is dependent on hardware mode. The HwMode predicate is
added as a pattern predicate on the duplicated pattern.
    
RISC-V uses HwMode on the GPR register class which means almost every
isel pattern is affected by HwMode. This results in the isel table
being nearly twice the size it would be if we only had a single GPR
size.

This patch proposes to do the expansion at instruction selection time
instead. To accomplish this new opcodes like OPC_CheckTypeByHwMode
are added to the isel table. The unique combinations of types and HwMode
are converted to an index that is the payload for the new opcodes.
TableGen emits a new virtual function getValueTypeByHwMode that uses
this index and the current HwMode to look up the type.

This reduces the size of the isel table on RISC-V from ~2.38 million
bytes to ~1.38 million bytes.

I did not add an OPC_SwitchTypeByHwMode opcode yet. If the VT requires a
hardware mode, we emit an OPC_Scope+OPC_CheckTypeByHwMode instead. I
expect adding an OPC_SwitchTypeByHwMode could further reduce the table
size. I will investigate this as a follow up.
    
Many of the matcher classes in tablegen now use ValueTypeByHwMode
insteadof MVT. This may have an impact on the memory usage and runtime of
tablegen. We can mitigate some of this by splitting the matchers into MVT and
ValueTypeByHwMode versions. We can also explore alternate data
structures for ValueTypeByHwMode instead of a std::map. Maybe a sorted vector.

A similar change can be made to GlobalISel as a follow up.
2026-01-15 09:35:02 -08:00
Luke Hutton
6bb2043859
[mlir][tosa] Add pass to assign static input shape to TOSA functions (#171156)
This commit introduces the `--tosa-experimental-input-shape` pass, which
allows a user to convert dynamically shaped input arguments of TOSA
functions to a user defined static shape. Here is a simple example:
```bash
func.func @test(%arg0: tensor<2x?xi32>, %arg1: tensor<?x256xf32>, %arg2: tensor<?x9xf32>) -> (tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>) {
    %0 = tosa.add %arg0, %arg0 : (tensor<2x?xi32>, tensor<2x?xi32>) -> tensor<2x?xi32>
    %1 = tosa.reciprocal %arg1 : (tensor<?x256xf32>) -> tensor<?x256xf32>
    %2 = tosa.sub %arg2, %arg2 : (tensor<?x9xf32>, tensor<?x9xf32>) -> tensor<?x9xf32>
    return %0, %1, %2 : tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>
}

$ mlir-opt --tosa-experimental-input-shape="args=arg0:2x16,arg2:64x9" test.mlir
func.func @test(%arg0: tensor<2x16xi32>, %arg1: tensor<?x256xf32>, %arg2: tensor<64x9xf32>) -> (tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>) {
    %0 = tosa.add %arg0, %arg0 : (tensor<2x16xi32>, tensor<2x16xi32>) -> tensor<2x?xi32>
    %1 = tosa.reciprocal %arg1 : (tensor<?x256xf32>) -> tensor<?x256xf32>
    %2 = tosa.sub %arg2, %arg2 : (tensor<64x9xf32>, tensor<64x9xf32>) -> tensor<?x9xf32>
    return %0, %1, %2 : tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>
}
```

When used in conjunction with the `--tosa-infer-shapes` pass, it can be
used to resolve simple TOSA functions (those that don't include TOSA
shape operations) to propagate static shape information. Continuing from
the example above:
```bash
$ mlir-opt --tosa-infer-shapes test2.mlir
func.func @test(%arg0: tensor<2x16xi32>, %arg1: tensor<?x256xf32>, %arg2: tensor<64x9xf32>) -> (tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>) {
    %0 = tosa.add %arg0, %arg0 : (tensor<2x16xi32>, tensor<2x16xi32>) -> tensor<2x16xi32>
    %cast = tensor.cast %0 : tensor<2x16xi32> to tensor<2x?xi32>
    %1 = tosa.reciprocal %arg1 : (tensor<?x256xf32>) -> tensor<?x256xf32>
    %2 = tosa.sub %arg2, %arg2 : (tensor<64x9xf32>, tensor<64x9xf32>) -> tensor<64x9xf32>
    %cast_0 = tensor.cast %2 : tensor<64x9xf32> to tensor<?x9xf32>
    return %cast, %1, %cast_0 : tensor<2x?xi32>, tensor<?x256xf32>, tensor<?x9xf32>
}
```
Note: tosa-infer-shapes currently doesn't have an option to update the
function signature.

Co-authored-by: Kaushik Varadharajan <kaushik.varadharajan@arm.com>
2026-01-15 17:31:34 +00:00
Simon Pilgrim
d5a567870a
[X86] SimplifyDemandedVectorEltsForTargetNode - reduce instruction size if upper half of X86ISD::PCLMULQDQ isn't demanded (#176199)
If the upper subvector half of a 256/512-bit X86ISD::PCLMULQDQ node
isn't demanded, then split the operands and perform using a smaller
instruction
2026-01-15 17:25:34 +00:00
Jean-Didier PAILLEUX
1d4f9ac37c
[flang] Fix crash with coarray teams #171048 (#172259)
This PR updates the `CHANGE TEAM` construct to fix the bug mentioned in
the issue #171048.
When a construct such as `IfConstruct` was present in the `CHANGE TEAM`
region, several BB were created but outside the region.
2026-01-15 18:02:07 +01:00
Mikhail Gudim
ec6b7a3e1a
[CFIInstrInserter][NFC] Move class CSRSavedLocation definition. (#176053)
This is needed to minimize diff for the future commit where we plan to
use `CSRSavedLocation` in `stuct MBBCFAInfo`.
2026-01-15 08:59:39 -08:00
Teresa Johnson
fcc0ae1fc4
[MemProf] Handle weak alias and aliasee prevailing in different modules (#176083)
For ThinLTO we only have the cloning information in the FunctionSummary,
so for aliases we create as many clones as there are aliasee clones in
the LTO backend. However, that information is only in the prevailing
symbol's summary, as we don't keep the memprof summary information for
other copies (to reduce memory and compile time).

In the case of weak aliases, it is possible that the prevailing copy
of the alias may be in a different module than the prevailing copy of
the aliasee (e.g. when a module with a weak_odr aliasee definition does
not have a def of the weak_odr alias and is listed first on the link
line). In that case, we were not creating the expected clones of the
alias.

Rather than a more complex solution that adds additional summary
information, detect this case and simply don't add the callsites in the
aliasee function to the callsite context graph. This will result in
conservativeness (because we can't clone through that function), but
this should be a corner case.
2026-01-15 08:52:23 -08:00
Anshul Nigham
e3560f29e6
[NewPM] Port x86-seses to new pass manager (#176096) 2026-01-15 16:44:23 +00:00
Alex MacLean
0cdaa8f612
[NVPTX] Update various intrinsic attributes, nfc cleanup (#175660)
This patch migrates the intrinsic properties back to "PureIntrinsic"
from "NVVMPureIntrinsic" (after PR #166450).

While we are there:
* Refactor a few mbarrier intrinsics definitions (NFC)
* Update mbarrier.pending_count properties. (trivial)
* Formatting changes over a few fence intrinsics (NFC)
2026-01-15 08:21:51 -08:00
Aiden Grossman
5acb608b52
[CI] Make premerge jobs support GHA postcommit (#176180)
This was causing failures in the release branch as the premerge jobs
there are also run postcommit through GHA. We were expecting a PR number
to always be present when it was not.
2026-01-15 08:16:39 -08:00
Nishant Patel
3150b73dec
[MLIR][XeGPU] Clean up helpers in XeGPUPropagateLayout (#175857)
In XeGPUPropagateLayout.cpp, the helper getDefaultSIMTLayoutInfo is
implemented via multiple overloads that differ significantly in
semantics, not just parameter types.
Reusing the same function name for these semantically different
behaviors makes call sites harder to read and reason about and increases
the maintenance burden. This PR improves readability and maintainability
of layout propagation logic.
2026-01-15 08:13:38 -08:00
Snehasish Kumar
1727337d8e
[profcheck] Reorder the FileCheck substitution. (#176098)
In the profcheck build, FileCheck commands are substituted with cat > /dev/null to disable output verification. In test/Transforms/SamplePrfile/remarks-hotness.ll we have both "FileCheck"
and "not FileCheck" statements. Replacing the positive one first results in "not cat". 
Run the not substitution first to fix this.
2026-01-15 08:08:18 -08:00
Rahul Joshi
f4d4caad94
[LLVM][CodeGen] Rename gc-empty-basic-blocks to enable-gc-empty-basic-blocks (#176018)
Rename the `gc-empty-basic-blocks` command line option to
`enable-gc-empty-basic-blocks` in preparation of adding calls to
initializing the pass in `initializeCodeGen` and also make the flag more
consistent with other existing flags to enable or disable passes.

Keep `gc-empty-basic-blocks` as an alias to allow all users to migrate
to the new option.
2026-01-15 08:00:07 -08:00
Mészáros Gergely
8e493b86c5
[Support] Suppress old MSVC warning for [[msvc::no_unique_address]] (#176130)
MSVC versions prior to 19.43 (Visual Studio 2022 version 17.13) emit a
warning when using the [[msvc::no_unique_address]] attribute prior to
C++20.

This is now considered a bug and fixed in later releases of MSVC.
Suppress the warning for older MSVC versions by disabling the warning
around the attribute usage. This allows for warning-free builds when
targeting older MSVC versions.

More details and discussion about the warning can be found here:
https://developercommunity.visualstudio.com/t/msvc::no_unique_address-Should-Not-W/10118435
2026-01-15 16:59:32 +01:00
Sam Elliott
6309cd8668
Revert "[NFC][MI] Tidy Up RegState enum use (1/2)" (#176190)
Reverts llvm/llvm-project#176091

Reverting because some compilers were erroring on the call to
`Reg.isReg()` (which is not `constexpr`) in a `constexpr` function.
2026-01-15 07:58:05 -08:00
Simon Pilgrim
e39d44c430
[X86] Add tests showing failure to split/concat X86ISD::PCLMULQDQ nodes (#176179) 2026-01-15 15:52:44 +00:00
Sam Elliott
1d616cdca3
[NFC][MI] Tidy Up RegState enum use (1/2) (#176091)
This Change is to prepare to make RegState into an enum class. It:
- Updates documentation to match the order in the code.
- Brings the `get<>RegState` functions together and makes them
`constexpr`.
- Adopts the `get<>RegState` where RegStates were being chosen with
ternary operators in backend code.
- Introduces `hasRegState` to make querying RegState easier once it is
an enum class.
- Adopts `hasRegState` where equivalent was done with bitwise
arithmetic.
- Introduces `RegState::NoFlags`, which will be used for the lack of
flags.
- Documents that `0x1` is a reserved flag value used to detect if
someone is passing `true` instead of flags (due to implicit bool to
unsigned conversions).
- Updates two calls to `MachineInstrBuilder::addReg` which were passing
`false` to the flags operand, to no longer pass a value.
- Documents that `getRegState` seems to have forgotten a call to
`getEarlyClobberRegState`.
2026-01-15 07:47:05 -08:00
Craig Topper
444adbe534
[RISCV] Change FPR256 to use the same allocation order as FPR16/32/64/128. (#176097)
The previous order was the LLVM 11 order for FPR16/32/64/128.
2026-01-15 07:35:12 -08:00
Matt Arsenault
282a065c5b
InstCombine: Handle multiple uses fabs in SimplifyDemandedFPClass (#176035) 2026-01-15 16:21:10 +01:00
Utkarsh Saxena
a866030810
[LifetimeSafety] Test lifetime safety on stmt-local analysis test suite (#175906)
Add CFG-based lifetime analysis tests for dangling pointer detection
alongside the existing AST-based analysis.

This change helps validate that the new CFG-based lifetime analysis
correctly detects the same dangling pointer issues as the existing
AST-based analysis. It also documents current limitations of the
CFG-based approach with FIXME comments, providing a roadmap for future
improvements. The test ensures that both analysis methods can work
side-by-side, with the CFG-based analysis eventually intended to replace
the AST-based approach.
2026-01-15 15:18:24 +00:00
mitchell
513062dd58
[clang-tidy] Fix performance-move-const-arg for trivially copyable types with private copy constructor (#175449)
Closes [#174826](https://github.com/llvm/llvm-project/issues/174826)
2026-01-15 23:13:14 +08:00
Akash Dutta
fc10fbb71e
Reapply "AMDGPU: Do not infer implicit inputs for !nocallback intrinsics" (#176081)
This reverts #174224 and re-applies #131759 .

Note: If #117544 is reverted, this should also be reverted.
2026-01-15 09:08:27 -06:00
Gabriel Baraldi
72a20b8e29
[SLPVectorizer] Check std::optional coming out of getPointersDiff (#175784)
Fixes https://github.com/llvm/llvm-project/issues/175768 
There are other unchecked uses std::optional in this pass but I couldn't
figure out a test that triggers them
2026-01-15 09:07:13 -06:00
David Stenberg
6fd8c36417
[DebugInfo] Drop stale entry value-limitation for call site values (#172340)
Entry value operations could previously not be combined with other
operations in debug expressions, meaning that we had to skip emitting
call site values in such cases. This DIExpression limitation was removed
in 57a371d7010802804343d17b85ac5e0d28d0f309, so we should be free to
emit call site values for such cases now, for example:

    extern void call(int, int);
    void entry_value (int param) {
        call(param + 222, param - 444);
    }

This change exposed a call site parameter entry order issue in the
dbgcall-site-expr-entry-value.mir test case. That ordering issue is
tracked in #43998, and I don't think there is anything inherent in this
patch that caused that.
2026-01-15 16:04:23 +01:00
Zahira Ammarguellat
bde808bf1c
[CLANG][OpenMP] Add support for OpenMP6.0 transparent clause. (#174646)
Add basic parsing and semantic support for transparent clause for task
andtaskloop directives described in Section 17.9.6 of
https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf
.
2026-01-15 09:48:24 -05:00
Simon Pilgrim
6bb2e778c7
[X86] combine-pclmul.ll - use non-constant values for demanded elts tests (#176165) 2026-01-15 14:37:44 +00:00
sadan4
262208728a
Fix typo in MSVCCompatibility.rst (#176057) 2026-01-15 13:02:34 +00:00
Steven Perron
0c5c920aa7
[SPIRV] Improve vector legalization and type deduction (#175067)
This patch adds support for scalarizing vector loads in the legalizer
and
implements legalization for the spv_const_composite intrinsic. It also
refactors stack temporary creation for vector operations to ensure
correct
SPIR-V types are assigned. Additionally, type deduction in the
PostLegalizer is improved to handle GEP and Load instructions.

Fixes https://github.com/llvm/llvm-project/issues/170534
2026-01-15 07:55:14 -05:00
Utkarsh Saxena
425e6bd85d
[LifetimeSafety] Handle GSL pointer construction from raw pointers (#175963) 2026-01-15 13:55:04 +01:00
Ebuka Ezike
6977e6812c
[lldb-dap] Move targetId and debuggerId into a session property (#175930)
This makes it clear the fields required for attaching to an existing
debug session.

It also makes it easier to check mutually exclusive fields required to
attach.
2026-01-15 12:37:36 +00:00
jeanPerier
86b1412195
[flang][NFC] fix typo in mlirTypeToIntrinsicFortran (#175762)
Fix pretty printing of complex function types in the error messages when
no runtime function is found to implement some intrinsic in lowering.
2026-01-15 13:32:31 +01:00
Mahesh-Attarde
ab6b6c95e0
[X86][GISEL] Enable Combines for constants and undef (#175711)
This patch supports combines for constants and undef. Primary motive is
to fold muls and remove undef chains from final outputs.
2026-01-15 13:27:39 +01:00
Volodymyr Turanskyy
dc5e1d05bf
[libc++] Provide flag for RUNTIMES_USE_LIBC=llvm-libc (#174967)
There was no flag added for llvm-libc when picolibc and newlib were
provided in https://github.com/llvm/llvm-project/pull/147956 - the
missing flag breaks libc++ iostream support now because this check
9a8421fa61/libcxx/include/__config (L719)
fails unless an LLVM libc header is included.
2026-01-15 12:24:39 +00:00
Mikhail Gudim
a60c9a942f
[CFIInstrInserter] Add dump method to CSRSavedLocation. (#176054)
This is to reduce the diff for the future commit where we plan to use
this for reporting errors.
2026-01-15 04:22:27 -08:00
Mikhail Gudim
1457732b66
[CFIInstrInserter][NFC] Remove useless #define. (#176051) 2026-01-15 04:17:53 -08:00
Mikhail Gudim
de4f43114c
[CFIInstrInserter] Fix a test. (#176048)
In the test `cfi-multiple-locations.mir` the block `bb.1` was
unreachable.
2026-01-15 04:17:17 -08:00
Jonas Hahnfeld
f6270bbcd5 [Serialization] Remove bail-out logic in TemplateArgumentHasher
While it is correct to assign a single fixed hash to all template
arguments, it can reduce the effectiveness of lazy loading and is
not actually needed: we are allowed to ignore parts that cannot be
handled because they will be analogously ignored by all hashings.

Reviewed as part of https://github.com/llvm/llvm-project/pull/133057
2026-01-15 13:06:34 +01:00
WANG Rui
16f690e0ff [JITLink][LoongArch][NFC] Fix Call30PCRel range docs 2026-01-15 19:58:13 +08:00
hev
019bf03697
[lld][LoongArch] Support reloc types for LA32R/LA32S (#172618)
This patch adds support for processing the relocation types introduced
in la-abi-specs v2.50.

Link: https://github.com/loongson/la-abi-specs/pull/16
Link:
https://sourceware.org/pipermail/binutils/2025-December/146091.html
2026-01-15 19:54:52 +08:00
Alexey Bataev
c322a0c462 [SLP]Do not throttle nodes with split parents, if any of scalars is used in more than one split nodes
If the the node to throttle is a vector node, which is used in split
node, and at least one scalar of such a node is used in many split
nodes, such vector node should be throttled. otherise there might be
wrong def-use chain, which crashes the compiler.

Fixes #175967
2026-01-15 03:50:45 -08:00
Simon Pilgrim
b2828bdf80
[X86] combine-pclmul.ll - add demanded elts test coverage (#176132)
Based off the equivalent instcombine test coverage - but we can now create X86ISD::PCLMULQDQ nodes in the DAG as well
2026-01-15 11:36:08 +00:00
Simon Pilgrim
314769fd2a
[X86] clmul.ll - add missing clmulr_i64 test coverage (#176131) 2026-01-15 11:27:29 +00:00
Stanislav Mekhanoshin
dd947ebcf3
[AMDGPU] Update gfx1250 memory model for global acquire/release (#175865)
Inserts required waits around GLOBAL_INV/GLOBAL_WBINV for
agent scope and above.
2026-01-15 03:25:03 -08:00
Nikita Popov
7abe5b73b5
[llvm-readobj][offload] Fix llvm-readobj --all on MachO (#175912)
Currently running llvm-readobj --all on any MachO object asserts,
because it implies --offload, and the --offload extraction includes an
assert on the object format. Instead, we should be silently ignoring.

This regressed in https://github.com/llvm/llvm-project/pull/143342.
2026-01-15 11:55:51 +01:00
Nikita Popov
8546294db9
[Hexagon] Use getSigned() for negative values in va_arg handling (#176115)
This avoids implicit truncation assertions with
https://github.com/llvm/llvm-project/pull/171456. Apparently the
alignment code path was previously untested.

The first commit switches the test to generated check lines.
2026-01-15 11:53:54 +01:00