22080 Commits

Author SHA1 Message Date
Simon Pilgrim
dca7b11a32 [X86] Add tests showing failure to reduce the vector width of vpmaddwd/vpmaddubsw/pmulhrsw nodes (#180728)
Missing demanded elts handling
2026-02-10 12:45:21 +00:00
Benjamin Maxwell
b91eb9b4e5
[SDAG] Implement missing legalization for ISD::VECTOR_FIND_LAST_ACTIVE (#180290)
This lowers the splitting as:
```
any_active(hi_mask)
  ? (find_last_active(hi_mask) + lo_mask.getVectorElementCount())
  : find_last_active(lo_mask)
```

And trivially lowers `<1 x i1>` scalarization to returning zero. Which
is a natural result of the splitting (and the lack of a sentinel
"none-active" result value).

The lowerings likely can be improved. This patch is for completeness.

Should fix:
https://github.com/llvm/llvm-project/pull/178862#issuecomment-3862310334
Fixes #180212
2026-02-10 09:01:13 +00:00
Kyungtak Woo
a56b877056
[NewPM] Port x86-global-base-reg (#180119)
Had to move X86GlobalBaseRegPass to its own file like in
https://github.com/llvm/llvm-project/pull/179864

No test coverage added for now as there are no MIR->MIR tests exercising
this pass and we do not have enough ported to run any end to end tests.

This is a redo of https://github.com/llvm/llvm-project/pull/180070
2026-02-09 22:54:41 -08:00
Simon Pilgrim
a911fc12ec
[X86] Fold expand(splat,passthrough,mask) -> select(splat,passthrough,mask) (#180238)
If all elements of the expansion vector are already splatted in place then we can use a vselect directly
2026-02-09 16:15:41 +00:00
Simon Pilgrim
964651ad51
[X86] Allow handling of i128/256/512 SELECT on the FPU (#180197)
If the scalar integer selection sources are freely transferable to the
FPU, then splat to create an allbits select condition and create a
vector select instead
2026-02-09 10:34:02 +00:00
JaydeepChauhan14
fad32ff3ea
[X86] Optimized ADC + ADD to ADC (#176713) 2026-02-09 11:43:56 +05:30
paperchalice
c53acf0443
[SelectionDAGBuilder] Remove NoNaNsFPMath uses (#169904)
Replaced by checking fast-math flags or value tracking results.
2026-02-09 09:48:07 +08:00
Folkert de Vries
0d94148b63
[X86] optimize 512-bit masked truncated saturating stores (#179130)
an oversight in https://github.com/llvm/llvm-project/pull/169827, for
the 512-bit version the `vl` target feature is not needed.


https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_mask_cvtsepi16_storeu_epi8&expand=1811&ig_expand=2150,2151
2026-02-08 12:04:16 +01:00
Qinkun Bao
2a74e02a90
Revert "[SelectionDAG] Fix null pointer dereference in resolveDanglingDebugInfo" (#180352)
Reverts llvm/llvm-project#174341

Break https://lab.llvm.org/buildbot/#/builders/24/builds/17324
2026-02-07 16:47:17 +00:00
Haoren Wang
9e8caa7834
[SelectionDAG] Fix null pointer dereference in resolveDanglingDebugInfo (#174341)
## Summary
Fix null pointer dereference in
`SelectionDAGBuilder::resolveDanglingDebugInfo`.

## Problem
`Val.getNode()->getIROrder()` is called before checking if
`Val.getNode()` is null, causing crashes when compiling code with debug
info that contains aggregate constants with nested empty structs.

## Solution
Move the `ValSDNodeOrder` declaration inside the `if (Val.getNode())`
block.

## Test Case
Reproduces with aggregate types containing nested empty structs:
```llvm
%3 = insertvalue { { i1, {} }, ptr, { { {} }, { {} } }, i64 } 
     { { i1, {} } zeroinitializer, ptr null, { { {} }, { {} } } zeroinitializer, i64 2 }, 
     ptr %2, 1, !dbg !893

## Crash stack
0.      Program arguments: llc-20 -O3 -mcpu=native -relocation-model=pic -filetype=obj /cloudide/workspace/temp/sf.ll -o /dev/null
1.      Running pass 'Function Pass Manager' on module '/cloudide/workspace/temp/sf.ll'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@filter_create'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.so.20.1 0x00007ff87ebbdf86 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 54
1  libLLVM.so.20.1 0x00007ff87ebbbb90 llvm::sys::RunSignalHandlers() + 80
2  libLLVM.so.20.1 0x00007ff87ebbe640
3  libpthread.so.0 0x00007ff87db79140
4  libLLVM.so.20.1 0x00007ff87f3fd2ff llvm::SelectionDAGBuilder::resolveDanglingDebugInfo(llvm::Value const*, llvm::SDValue) + 303
5  libLLVM.so.20.1 0x00007ff87f3fda5e llvm::SelectionDAGBuilder::getValue(llvm::Value const*) + 142
6  libLLVM.so.20.1 0x00007ff87f3fe79f llvm::SelectionDAGBuilder::getValueImpl(llvm::Value const*) + 3343
7  libLLVM.so.20.1 0x00007ff87f3fda34 llvm::SelectionDAGBuilder::getValue(llvm::Value const*) + 100
8  libLLVM.so.20.1 0x00007ff87f3fc1ab llvm::SelectionDAGBuilder::visitInsertValue(llvm::InsertValueInst const&) + 603
9  libLLVM.so.20.1 0x00007ff87f3eeaf7 llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 327
10 libLLVM.so.20.1 0x00007ff87f4904b8 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true, llvm::BasicBlock>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void, true, llvm::BasicBlock>, false, true>, bool&) + 72
11 libLLVM.so.20.1 0x00007ff87f490304 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 5956
12 libLLVM.so.20.1 0x00007ff87f48e2b4 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 372
13 libLLVM.so.20.1 0x00007ff87f48c689 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) + 169
14 libLLVM.so.20.1 0x00007ff87efb8e32 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 610
15 libLLVM.so.20.1 0x00007ff87ed104be llvm::FPPassManager::runOnFunction(llvm::Function&) + 638
16 libLLVM.so.20.1 0x00007ff87ed15ff3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
17 libLLVM.so.20.1 0x00007ff87ed10c11 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1105
18 llc-20          0x000055972ce77dc1 main + 9649
19 libc.so.6       0x00007ff87d68ad7a __libc_start_main + 234
20 llc-20          0x000055972ce7247a _start + 42
```

## Testing

Added regression tests in:
- `CodeGen/X86/selectiondag-dbgvalue-null-crash.ll`
- `CodeGen/AArch64/selectiondag-dbgvalue-null-crash.ll`

**Note:** Tests appear to expose deeper issues in DWARF generation on
certain targets (Darwin targets for example) that require further
investigation.

## Related PRs

This supersedes:
- #173500 - Initial fix, reverted due to test failures on Darwin and
other platforms
- #173836 - Second attempt with `UNSUPPORTED: system-darwin`, still
failed on some targets
2026-02-07 13:00:30 +01:00
Ganesh
a362593e0d
[X86] AMD Zen 6 Initial enablement (#179150)
This patch adds initial support for AMD Zen 6 architecture (znver6):

- Added znver6 CPU target recognition in Clang and LLVM
- Updated compiler-rt CPU model detection for znver6
- Added znver6 to target parser and host CPU detection
- Added znver6 to various optimizer tests

znver6 features: FP16, AVXVNNIINT8, AVXNECONVERT, AVXIFMA (without BMM).
2026-02-07 09:38:10 +05:30
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
Mikhail Gudim
bf4f5d2194
[X86][test] Auto-generate test checks for some cfi tests. NFC (#177248) 2026-02-06 12:54:42 -08:00
Mingming Liu
544caa627b
[StaticDataLayout] Reconcile string literal hotness from data access profiles and PGO profiles. (#178336)
https://github.com/llvm/llvm-project/pull/178333 updates the memprof
pass to annotate string literal section prefix.

The StaticDataProfileInfo.cpp provides an analysis pass to reconcile
global variable hotness. It's used by StaticDataAnnotator and AsmPrinter
to look up global variable hotness.

This PR updates the analysis pass to compute the hotness of string
literals.
* When both data access profiles and pgo counters provide a hotness
attribute, use the hotter one.
* Otherwise, use the hotness attribute that's available.

Implementation-wise, the option `AnnotateStringLiteralSectionPrefix` is
moved from MemProf (a transform pass) to StaticDataProfileInfo (an
Analysis pass). Otherwise, there might be errors like caught by CI. Note
https://github.com/llvm/llvm-project/pull/178336#issuecomment-3808537817
is an edited message, and its history shows the intermediate failures
like below. ~My understanding is~ Preliminary LLM study (:)) shows that
the error manifests in PowerPC but not X86 due to cmake variable
differences.

```
FAILED: unittests/Target/PowerPC/PowerPCTests
...
>>> referenced by CommandLine.h:1437 (/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/CommandLine.h:1437)
>>>               StaticDataProfileInfo.cpp.o:(llvm::StaticDataProfileInfo::getConstantSectionPrefix(llvm::Constant const*, llvm::ProfileSummaryInfo const*) const) in archive lib/libLLVMAnalysis.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```
2026-02-06 09:49:14 -08:00
Kerem Şahin
29891ec07c
[SelectionDAG] Use -filetype=null for llc RUN lines in pr142937 (#180004)
This patch adds -filetype=null to the llc RUN lines in pr142937.ll, to
ensure that the test does not attempt to write files to the local
directory.

Follow-up to #179249.
2026-02-06 08:33:51 -08:00
David Sherwood
e958bcdd17
[DAGCombiner] Look through freeze for ext(freeze(extload(x))) (#178669)
This patch fixes a regression introduced by PR #175022, where
a freeze was introduced with the following transformation:

  ext(freeze(load(x))) -> freeze(extload(x))

If a new extend is introduced afterwards we then have

  ext(freeze(extload(x)))

which doesn't get picked up by existing DAG combines due to
the freeze getting in the way.
2026-02-06 15:50:17 +00:00
Simon Pilgrim
4066ef6ace
[X86] Add test showing failure to fold expand(splat,passthrough,mask) to select(splat,passthrough,mask) (#180208) 2026-02-06 15:40:01 +00:00
Simon Pilgrim
197bfa9a74
[X86] Add tests showing potential for vectorising i128/256/512 select nodes (#180173) 2026-02-06 12:17:01 +00:00
Nikita Popov
0287d789e0
[ExpandIRInsts] Freeze input in itofp expansion (#180157)
We are introducing branches on the value, and branch on undef/poison is
UB, so the value needs to be frozen.
2026-02-06 12:52:31 +01:00
Steffen Larsen
5654ecd5dd
[DAGCombiner] Fix exact power-of-two signed division for large integers (#177340)
Previously, the DAG combiner did not optimize exact signed division by a
power-of-two constant divisor for integer types exceeding the size of
division supported by the target architecture (e.g., i128 on x86-64).
However, such an optimization was expected by the division expansion
logic, leading to unsupported division operations making it to
instruction selection.
This commit addresses this issue by making an exception to the existing
exclusion of signed division with the exact flag for the aforementioned
operations. That is, the DAG combiner will now optimize exact signed
division if the divisor is a power-of-two constant and the integer type
exceeds the size of division supported by the target architecture.

---------

Signed-off-by: Steffen Holst Larsen <HolstLarsen.Steffen@amd.com>
2026-02-06 09:40:32 +01:00
JaydeepChauhan14
d50cf09520
Precommit test for combine ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry) (#177539)
**Reference PR-** https://github.com/llvm/llvm-project/pull/176713
2026-02-06 13:23:42 +05:30
Kyungtak Woo
4092a6398c
[NewPM] Port x86-indirect-branch-tracking (#179874)
Similar to other portings created by @aidenboom154. No specific test
coverage as there are no MIR->MIR tests that exercise this pass.
2026-02-06 07:37:58 +00:00
Simon Pilgrim
cc4b98e505
[X86] combineSetCC - attempt to match more complex icmp_eq/ne patterns before falling back to PTEST/PMOVMSKB patterns (#180034)
combineVectorSizedSetCCEquality attempts to convert equality comparisons
of larger-than-legal scalar integers to PTEST/PMOVMSKB vector
comparisons.

However, combineSetCC has a number of other folds with more complex
icmp_eq/ne patterns that work with big integers (including bit test and
reduction patterns) that don't get a change to match as
combineVectorSizedSetCCEquality is run first, and the other folds are
then more difficult to match from PTEST/PMOVMSKB nodes.

This patch moves the combineVectorSizedSetCCEquality fold later to give
other icmp_eq/ne folds a chance to run first.
2026-02-06 07:20:14 +00:00
Kyungtak Woo
eb9e98f62e
[NewPM] Port x86-cleanup-local-dynamic-tls (#179864)
Port x86-cleanup-local-dynamic-tls to the new pass manager.
I moved LDTLSCleanup to a new
llvm/lib/Target/X86/X86CleanupLocalDynamicTLS.cpp file and renamed it to
X86CleanupLocalDynamicTLSPass. Then I renamed the legacy pass, and
adding a NewPM wrapper around the impl.

No test coverage added for now as there are no MIR->MIR tests exercising
this pass and we do not have enough ported to run any end to end tests.
2026-02-06 08:31:01 +08: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
Phoebe Wang
744827e22f
[X86] Fixed truncated masked stores (#179853)
Fixes: #179489
2026-02-05 21:06:17 +08:00
keremsahn
f6e130682f
[SelectionDAG] Mark LowerTypeTests as required and remove intrinsic handling from #142939 (#179249)
Fixes #179125
2026-02-05 11:16:48 +01:00
Simon Pilgrim
9e052debf0
[X86] lower1BitShuffle - recognise a blend shuffle that can lower to AND/MASKZ pattern (#179717)
Part of the missed-optimisation mentioned on #179630 - if the shuffle is
a blend with zero, then lower as a ISD::AND pattern
2026-02-05 09:42:31 +00:00
Anshul Nigham
34523c200b
[NewPM] Port x86-lvi-load (#179371) 2026-02-04 19:02:00 -08: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
Jay Foad
2828ee6bc2
[X86] Fix incorrect SUBREG_TO_REG usage in a MIR test (#179682) 2026-02-04 16:21:47 +00:00
Islam Imad
3c0e3268a5
[X86] Lower i512 ADD/SUB using Kogge-Stone on AVX512 (#174761)
Closes #173996
2026-02-04 16:07:59 +00:00
Simon Pilgrim
0fe9454c56
[X86] Fold EXPAND(X,Y,M) -> SELECT(M,X,Y) when M is a lowest bit mask (#179630)
If a EXPAND node mask is just the lowest bits, then we can replace it
with a more general SELECT node, which can be cheaper and potentially
allow predication.

Fixes #179008
2026-02-04 11:45:13 +00:00
Shamshura Egor
280833247d
[X86] computeKnownBitsForTargetNode - extend X86ISD::BZHI handling. Fixes 177364. (#179444)
Fixes #177364
2026-02-04 10:55:23 +00:00
bala-bhargav
a631f3e434
[X86] Fold vgf2p8affineqb XOR with splat constant into immediate (#179103)
The vgf2p8affineqb instruction performs an affine transformation on each
byte and then XORs the result with an 8-bit immediate operand. When this
instruction is followed by a standalone XOR with a splatted constant,
LLVM currently generates extra instructions instead of folding the
constant into the instruction's immediate.
This PR adds a DAG combine optimization that detects the pattern
vgf2p8affineqb(x, m, imm8) ^ C where C is a splatted 8-bit constant and
transforms it to vgf2p8affineqb(x, m, imm8 ^ C), eliminating the
unnecessary XOR instruction.
- The optimization runs during the combine phase after type legalization
- Handles XOR with the constant on either side (commutative)
- Only applies when the GFNI instruction has a single use to avoid
de-optimization
- Validates that the XOR operand is a splatted 8-bit constant before
folding
- Includes test coverage for positive cases and negative cases
(multi-use, non-splat constant, variable XOR)
2026-02-04 10:11:48 +00:00
Simon Pilgrim
dd02b404b0
[X86] Lower CTTZ/CTLZ vXi8 vectors using GF2P8AFFINEQB (#118012)
CTTZ can be lowered using GF2P8AFFINEQB if we isolate the lowest set bit
(or is zero) and then use GF2P8AFFINEQB to perform a look up

With CTTZ, CTLZ can be lowered as CTTZ(BITREVERSE())

As discussed on #110308
2026-02-04 09:14:32 +00:00
Simon Pilgrim
3bd2ae7127
[X86] Add test coverage for #179008 (#179562) 2026-02-03 23:08:38 +00:00
Fangrui Song
0b4147e0bc
[X86] Restrict offset folding into address mode in 16-bit mode (#179399)
106549a436/src/pnpbios.c (L70)
has code that looks like
```
extern int X;
unsigned f(void) { return (unsigned)&X - 0xf0000; }
```

which compiles (-O1 or above, -fno-pic) to

```
.code16
leal X-983040, %eax  # R_386_16 relocation, [-65535,65535]
```
in 16-bit mode. This is rejected by both GNU Assembler and LLVM
integrated assembler (after #176827).

Restrict offset folding in 16-bit mode to the range [-65535, 65535].
2026-02-03 17:07:09 +00:00
Anshul Nigham
26921d74ef
[NewPM] Fix callsite for x86-lvi-ret (#179383) 2026-02-02 21:05:04 -08:00
Anshul Nigham
266a45128a
[NewPM] Port x86-wineh-unwindv2 (#179172) 2026-02-02 07:24:23 -08:00
Mahesh-Attarde
9d5a42c841
[X86][GISEL] Enable PostLegalize Combiner (#174696)
This patch adds post legalize combiner for X86 Target.

Use case for OptNone Combine: I am curious about OptNone usecase,
specifically when we are using -On on command line and no opt on
specific function.
2026-02-02 10:49:08 +00:00
Phoebe Wang
2f3935bcee
[X86][APX] Disable PP2/PPX generation on Windows (#178122)
The PUSH2/POP2/PPX instructions for APX require updates to the Microsoft
Windows OS x64 calling convention documented at
https://learn.microsoft.com/en-us/cpp/build/exception-handling-x64?view=msvc-170
due to lack of suitable unwinder opcodes that can support APX
PUSH2/POP2/PPX.

The PR request disables this support by default for code robustness;
workloads that choose to explicitly enable this support can change the
default behavior by explicitly specifying the flag options that enable
this support e.g. for experimentation or code paths that do not need
unwinder support.
2026-02-02 18:01:44 +08:00
Abhiram Jampani
3377756a5b
[X86] checkSignTestSetCCCombine - handle SIGN_EXTEND_INREG/SHL patterns inside CMP(X,0) (#178710)
Handle SIGN_EXTEND_INREG and SHL patterns inside CMP(X,0) cases in checkSignTestSetCCCombine.

Fixes #178246
2026-02-02 09:31:39 +00:00
Simon Pilgrim
a372152cb5
[DAG] visitVECTOR_SHUFFLE - ensure correct resno when folding shuffle(bop(shuffle(x,y),shuffle(z,w)) (#179124)
TLI.isBinOp recognises some opcodes that have multiple results,
including UADDO etc.

In most cases we currently just bail if a binop has multiple results,
but shuffle combining was missing the check and its pretty trivial to
add handling in this case.

I've added add/sub-overflow opcodes to verifyNode to help catch these
cases in the future - IIRC there was a plan to autogen these, but there
isn't anything at the moment.

Fixes #179112
2026-02-02 09:22:48 +00:00
Simon Pilgrim
49d2323447
[X86] getScalarMaskingNode - FIXUPIMM scalar ops take upper elements from second operand (#179101)
FIXUPIMMSS/SD instructions passthrough the SECOND operand upper elements, and not the first like most (2-op) instructions

Fixes #179057
2026-02-01 14:00:53 +00:00
Simon Pilgrim
618d71dc98
[X86] Add test coverage for #179057 (#179092)
Incorrect folding of fixupimm scalar intrinsics passthrough when the
mask is known zero
2026-02-01 10:57:51 +00:00
Simon Pilgrim
aee02c1bcb
[X86] absolute-bt.ll - regenerate test checks (#178935) 2026-01-30 18:46:41 +00:00
Marina Taylor
7994daccd9
[AsmPrinter] Add a command-line option to emit stack usage files (#178908)
Preparation for #178005.

This will allow stack usage files to be requested during the linking
step in LTO builds, in a more straightforward way than via
TargetOptions.
2026-01-30 18:10:08 +00:00
陈子昂
a994198906
[DAG] Reland: Enable bitcast STLF for Constant/Undef (#178890)
This is a reland of #172523.

The original patch caused an assertion failure on RISC-V because it
attempted to create a bitcast from an illegal type (i32 on RV64) during
the post-type-legalization DAGCombine stage.

Added a `TLI.isTypeLegal(Val.getValueType())` check to ensure we only
proceed with the bitcast STLF optimization when the source value's type
is legal for the target.
2026-01-30 18:21:32 +01:00
Alex Bradbury
41f453efe2
Revert "[DAG] Enable bitcast STLF for Constant/Undef" (#178872)
Reverts llvm/llvm-project#172523

As explained in
https://github.com/llvm/llvm-project/pull/172523#issuecomment-3823234270
(along with reproducer), this causes compiler crashes building
llvm-test-suite for RVV targets.
2026-01-30 12:18:38 +00:00