LLVM/project 0cfc219llvm/test/CodeGen/M68k/GlobalISel reg_bank_test.ll

[M68K] Prefer reg-bank-select (#217632)

Broken by #217486. This fixes the tests.

https://lab.llvm.org/buildbot/#/builders/27/builds/3837
DeltaFile
+1-1llvm/test/CodeGen/M68k/GlobalISel/reg_bank_test.ll
+1-11 files

LLVM/project f8a076aclang/include/clang/Basic BuiltinsAMDGPUDocs.td BuiltinsAMDGPU.td, llvm/include/llvm/IR IntrinsicsAMDGPU.td

[NFC][AMDGPU] Introduce a new target feature for N=16 WMMAs (#217506)
DeltaFile
+30-28llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+28-28clang/include/clang/Basic/BuiltinsAMDGPU.td
+20-0clang/include/clang/Basic/BuiltinsAMDGPUDocs.td
+10-5llvm/lib/Target/AMDGPU/VOP3PInstructions.td
+7-1llvm/lib/Target/AMDGPU/AMDGPU.td
+95-625 files

LLVM/project f47b8b0llvm/lib/Target/AMDGPU GCNSchedStrategy.cpp, llvm/test/CodeGen/AMDGPU sched_mfma_rewrite_diff_types.mir gfx-callable-argument-types.ll

[AMDGPU][CodeGen] Allow remat with multiple users in multiple regions

This relaxes one of the constraints on rematerialization candidates in
the scheduler's `PreRARematStage`. The current implementation only allows
rematerializing a register if it has users in a single region. This
allows it when a register has multiple users in multiple regions.

In such cases the register is rematerialized as many times as there are
using regions, just before the first user in each using region. The cost
model for assessing rematerialization opportunities now takes into
account that mutliple new instructions may be created for each candidate.
DeltaFile
+664-537llvm/test/CodeGen/AMDGPU/sched_mfma_rewrite_copies.mir
+202-167llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats.mir
+102-61llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+36-25llvm/test/CodeGen/AMDGPU/sched_mfma_rewrite_cost.mir
+22-24llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll
+17-12llvm/test/CodeGen/AMDGPU/sched_mfma_rewrite_diff_types.mir
+1,043-8262 files not shown
+1,047-8328 files

LLVM/project cce1e0cllvm/unittests/CodeGen RegisterPressureTest.cpp

Add missing include + newline
DeltaFile
+2-1llvm/unittests/CodeGen/RegisterPressureTest.cpp
+2-11 files

LLVM/project 5abe31ellvm/include/llvm/CodeGen RegisterPressure.h, llvm/lib/CodeGen MachineScheduler.cpp RegisterPressure.cpp

[CodeGen] Correctly classify/mark dead defs when adjusting lane liveness

Despite what the documentation of `adjustLaneLiveness` suggests, the
method never sets dead flags on dead def operands, even when missing
dead flags can later lead to machine verifier errors.

This makes the method identify dead definitions from definitions that
are initially thought to be alive, and makes it add a dead flag on the
last definition of a virtual register, matching the behavior expected
by the machine verifier (ref. "Instruction ending live segment on dead
slot has no dead flag").

`adjustLaneLiveness` and `detectDeadDefs` now also use the same
mechanism to identify dead definitions. It relies on comparing the
defined lanes of a definition with those that stay alive after it.
DeltaFile
+90-0llvm/unittests/CodeGen/RegisterPressureTest.cpp
+24-27llvm/lib/CodeGen/RegisterPressure.cpp
+13-8llvm/include/llvm/CodeGen/RegisterPressure.h
+2-2llvm/lib/CodeGen/MachineScheduler.cpp
+1-1llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+1-0llvm/unittests/CodeGen/CMakeLists.txt
+131-386 files

LLVM/project 588e5b6llvm/include/llvm/CodeGen RegisterPressure.h, llvm/lib/CodeGen MachineScheduler.cpp RegisterPressure.cpp

[CodeGen] Overload `adjustLaneLiveness` to cleanly split use cases (NFC) (#215594)

When providing a non-null `AddFlagsMI` it makes no sense to pass a `Pos`
that is not `AddFlagsMI`'s own position. In such cases the position can
be queried from the MI directly, avoiding possible inconsistencies.

This splits `RegisterOperands::adjustLaneLiveness` into two overloads
whose behavior only differ in whether an MI's operand flags are updated
in the process.
DeltaFile
+47-29llvm/lib/CodeGen/RegisterPressure.cpp
+19-5llvm/include/llvm/CodeGen/RegisterPressure.h
+2-4llvm/lib/CodeGen/MachineScheduler.cpp
+1-2llvm/unittests/CodeGen/RematerializerTest.cpp
+1-2llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+1-2llvm/lib/Target/AMDGPU/GCNIterativeScheduler.cpp
+71-446 files

LLVM/project 81c8ea8llvm/include/llvm/IR PISAIntrinsicUtils.h IntrinsicsPISA.td, llvm/include/llvm/Support PISAAddrSpace.h

Change ordering, add links to PISA spec
DeltaFile
+13-3llvm/include/llvm/IR/IntrinsicsPISA.td
+8-0llvm/include/llvm/IR/PISAIntrinsicUtils.h
+2-0llvm/include/llvm/Support/PISAAddrSpace.h
+23-33 files

LLVM/project eee3cf1llvm/test/CodeGen/AMDGPU scalar-float-sop1.ll, llvm/test/CodeGen/AMDGPU/GlobalISel llvm.amdgcn.raw.buffer.store.format.f16.ll fma.bf16.ll

AMDGPU/GlobalISel: Bitcasting G_TRUNC combine

Creating the G_TRUNC that changes type as well. This is really
the LLT::scalar trunc style that we inherited from switching to
extended LLTs, very common on non-true16 targets.
Affects inst-select pattern matching that were blocked by bitcast.
DeltaFile
+99-115llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.raw.tbuffer.store.f16.ll
+65-139llvm/test/CodeGen/AMDGPU/GlobalISel/fptrunc.bf16.ll
+6-22llvm/test/CodeGen/AMDGPU/scalar-float-sop1.ll
+10-12llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.struct.buffer.store.format.f16.ll
+6-10llvm/test/CodeGen/AMDGPU/GlobalISel/fma.bf16.ll
+5-9llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.raw.buffer.store.format.f16.ll
+191-3078 files not shown
+216-34314 files

LLVM/project 8d03e3ellvm/test/CodeGen/AMDGPU load-atomic-flat.ll dagcombine-fmul-sel.ll, llvm/test/CodeGen/AMDGPU/GlobalISel fshr.ll fptrunc.bf16.ll

AMDGPU/GlobalISel: Fold (trunc (lshr x, 16)) to unmerge high half

Huge performance impact in some shaders with high register pressure.
What this really does is selects _hi16 register classes, and true16
machinery takes over later. Trunc + shift ends up in _lo16!
This requires allocating an extra register when the _lo16 half of the
original real 32-bit VGPR is still live.
DeltaFile
+566-304llvm/test/CodeGen/AMDGPU/load-atomic-global.ll
+558-300llvm/test/CodeGen/AMDGPU/load-atomic-local.ll
+387-222llvm/test/CodeGen/AMDGPU/dagcombine-fmul-sel.ll
+275-158llvm/test/CodeGen/AMDGPU/GlobalISel/fptrunc.bf16.ll
+231-126llvm/test/CodeGen/AMDGPU/load-atomic-flat.ll
+180-132llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
+2,197-1,24224 files not shown
+3,192-2,28530 files

LLVM/project c756203clang/lib/Driver/ToolChains CommonArgs.cpp, clang/test/Driver hip-cuid.hip amdgpu-xnack-sramecc-flags.c

clang/AMDGPU: Stop passing redundant -target-cpu to cc1

Now that the exact target is encoded in the triple's subarch field,
-target-cpu is redundant. This avoids polluting the resultant IR with
unwanted "target-cpu" attributes. The net result is the desired codegen
when compiling libraries for a major subarch and linking it into a
program compiled for a specific arch. e.g., compiling for "gfx9-generic"
would pollute the IR with "target-cpu"="gfx9-generic", so codegen
would ultimately be performed for the generic target even after
linking into the concrete gfx9 cpu. The specialization will now be
achieved by merging the triples without the linker or optimization
passes needing to fixup function attributes.
DeltaFile
+62-62clang/test/Driver/amdgpu-mcpu.cl
+26-26clang/test/Driver/hip-sanitize-options.hip
+12-16clang/test/Driver/hip-rdc-device-only.hip
+18-8clang/lib/Driver/ToolChains/CommonArgs.cpp
+10-10clang/test/Driver/amdgpu-xnack-sramecc-flags.c
+5-7clang/test/Driver/hip-cuid.hip
+133-12926 files not shown
+188-20932 files

LLVM/project d98d12clibcxx/docs/ReleaseNotes 24.rst, libcxx/include fstream

[libc++] Support file offsets larger than 2GB in basic_filebuf on 32-bit AIX and 32-bit glibc Linux (#215892)

Currently, opening files greater than 2GB on 32-bit AIX doesn't work,
even with `_LARGE_FILES` defined in the user program. A similar issue
exists with 32-bit glibc.

On AIX, the `_LARGE_FILES` macro enables programs to handle large files
(greater than 2GB). When `_LARGE_FILES` is defined, all data types,
structures, and subroutine names are mapped to their 64-bit versions
during preprocessing
([source](https://www.ibm.com/docs/en/aix/7.2.0?topic=volumes-writing-programs-that-access-large-files)).
Since the shared library is pre-compiled, defining the macro in user
programs doesn't affect fstream's open/seek/tell, causing failure with
large files on 32-bit.

Instead of building libc++ with `_LARGE_FILES` defined, which could
cause ODR violations, we can swap `fopen`/`fseeko`/`ftello` calls with
their 64-bit counter-parts.


    [3 lines not shown]
DeltaFile
+29-1libcxx/include/fstream
+0-5libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/offset_range.pass.cpp
+2-0libcxx/docs/ReleaseNotes/24.rst
+31-63 files

LLVM/project 7fe10a5utils/bazel/llvm-project-overlay/clang/unittests BUILD.bazel

[Bazel] Fixes c0125a7 (#217605)

This fixes c0125a7bf833b6cf0d5b4a085b63094e0893c85a (#206482).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=c0125a7bf833b6cf0d5b4a085b63094e0893c85a

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+1-0utils/bazel/llvm-project-overlay/clang/unittests/BUILD.bazel
+1-01 files

LLVM/project 40b01d0clang/lib/AST/ByteCode InterpBuiltin.cpp

[clang][bytecode] Remove a Pointer::toAPValue() call (#217594)

We can just use `computeLayoutOffset()` instead.
DeltaFile
+8-4clang/lib/AST/ByteCode/InterpBuiltin.cpp
+8-41 files

LLVM/project a5b63a5llvm/utils profcheck-xfail.txt

[ProfCheck] Temporarily opt out new VectorCombine test (#217612)

Introduced in #211022, disable for now while it gets fixed.
DeltaFile
+1-0llvm/utils/profcheck-xfail.txt
+1-01 files

LLVM/project 5ef2f7fclang/lib/CIR/CodeGen CIRGenExprConstant.cpp, clang/test/CIR/CodeGen fixed-point-literal.c

[CIR] Implement fixed-point global literals (#217125)

These just have an integral representation. The implementation here is
identical to classic-codegen, so I just added some spot-check tests to
make sure we do the same thing.
DeltaFile
+23-44clang/test/CIR/CodeGen/fixed-point-literal.c
+4-3clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+27-472 files

LLVM/project cc61111llvm/include/llvm/CodeGen MachineBasicBlock.h

[CodeGen] Give NewPM SplitCriticalEdge default values

To match the legacyPM version. This is needed for migrating
RegBankSelect without explicitly passing nullptr to these parameters,
which is not ideal given the LegacyPM version already sets them to
defaults.

Reviewers: arsenm, nikic

Pull Request: https://github.com/llvm/llvm-project/pull/217504
DeltaFile
+10-6llvm/include/llvm/CodeGen/MachineBasicBlock.h
+10-61 files

LLVM/project b245826clang/lib/CIR/CodeGen CIRGenExprScalar.cpp, clang/test/CIR/CodeGen fixed-point-conversions.cpp

[CIR] Lower Fixed-point conversions to ints/floats/self (#217347)

As the next step in implementing fixed-point NYIs, this patch goes
through and implements the conversion operations. LLVM has a conversion
class for these that generates LLVM, so this duplicates that as
mechanically as possible to convert to CIR. The result is that we end up
with effectively identical IR.

I DID consider 'wiring' this through as its own type, however it is a
rarely used feature and I fear that doing so will result in lost
optimization opportunties vs converting it to 'int' early.
DeltaFile
+1,354-0clang/test/CIR/CodeGen/fixed-point-conversions.cpp
+300-11clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+1,654-112 files

LLVM/project f8b445bflang/test/Integration/PowerPC ppc-vec-shift-be-le.f90 ppc-mma-outer-product-1.f90, flang/test/Lower/PowerPC ppc-mma-outer-product-1.f90

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+2,569-0llvm/test/CodeGen/AMDGPU/redundant-and.mir
+0-2,191llvm/test/CodeGen/AMDGPU/high-bits-zeroed-16-bit-ops.mir
+0-1,763llvm/test/Analysis/CostModel/RISCV/cast.ll
+1,709-0flang/test/Integration/PowerPC/ppc-mma-outer-product-1.f90
+0-1,701flang/test/Lower/PowerPC/ppc-mma-outer-product-1.f90
+1,420-0flang/test/Integration/PowerPC/ppc-vec-shift-be-le.f90
+5,698-5,655996 files not shown
+35,764-30,6451,002 files

LLVM/project fbbef72clang/lib/CodeGen CodeGenModule.cpp, clang/test/CodeGen arm-target-abi-module-flag.c

clang: Emit "target-abi" module flag for ARM

Previously only RISCV emitted the "target-abi" module flag.
We probably should just generally emit this for non-empty ABI names
but that's a broader behavior change. I'm also confused because the
clang side defines a non-empty value for many targets with no apparent
use in llvm.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+19-0clang/test/CodeGen/arm-target-abi-module-flag.c
+11-3clang/lib/CodeGen/CodeGenModule.cpp
+30-32 files

LLVM/project a706b2dllvm/lib/Target/AMDGPU AMDGPURegBankLegalizeHelper.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-load.mir regbankselect-freeze.mir

[AMDGPU][GISel] Rename amdgpu-reg-bank-legalize

Hyphenate to be consistent with other pass names like
amdgpu-reg-bank-select.

Reviewers: arsenm, vangthao95, aeubanks

Pull Request: https://github.com/llvm/llvm-project/pull/217488
DeltaFile
+17-17llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeHelper.cpp
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-load.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-freeze.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-fexp2.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.s.buffer.load.ll
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.ptr.s.buffer.load.ll
+32-32173 files not shown
+227-227179 files

LLVM/project 646ea6dllvm/lib/Target/ARM ARMSubtarget.cpp ARMTargetMachine.cpp, llvm/test/CodeGen/ARM target-abi-module-flag-conflict.ll module-target-abi.ll

ARM: Read the ABI from the "target-abi" module flag

This module flag is already used by RISCV, but ARM ignored it and
still exclusively relied on the -target-abi global option.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+30-0llvm/test/CodeGen/ARM/module-target-abi.ll
+21-0llvm/test/CodeGen/ARM/target-abi-module-flag-conflict.ll
+12-6llvm/unittests/Target/ARM/MachineInstrTest.cpp
+12-2llvm/lib/Target/ARM/ARMSubtarget.h
+11-1llvm/lib/Target/ARM/ARMTargetMachine.cpp
+6-5llvm/lib/Target/ARM/ARMSubtarget.cpp
+92-145 files not shown
+106-2111 files

LLVM/project 31e9531flang/test/Integration/PowerPC ppc-vec-shift-be-le.f90 ppc-mma-outer-product-1.f90, flang/test/Lower/PowerPC ppc-mma-outer-product-1.f90

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+2,569-0llvm/test/CodeGen/AMDGPU/redundant-and.mir
+0-2,191llvm/test/CodeGen/AMDGPU/high-bits-zeroed-16-bit-ops.mir
+0-1,763llvm/test/Analysis/CostModel/RISCV/cast.ll
+1,709-0flang/test/Integration/PowerPC/ppc-mma-outer-product-1.f90
+0-1,701flang/test/Lower/PowerPC/ppc-mma-outer-product-1.f90
+1,420-0flang/test/Integration/PowerPC/ppc-vec-shift-be-le.f90
+5,698-5,655996 files not shown
+35,764-30,6451,002 files

LLVM/project 24bee56llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-dyn-stackalloc.mir regbankselect-widen-scalar-loads.mir

[AMDGPU][GISel] Rename amdgpu-regbankselect amdgpu-reg-bank-select

To be more consistent with reg-bank-select and other passes that are
hyphenated rather than concatenated.

Reviewers: arsenm, vikramRH, aeubanks

Pull Request: https://github.com/llvm/llvm-project/pull/217487
DeltaFile
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-widen-scalar-loads.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-split-scalar-load-metadata.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-load.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-freeze.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-fexp2.mir
+2-2llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-dyn-stackalloc.mir
+17-17158 files not shown
+186-186164 files

LLVM/project 5432914flang/test/Integration/PowerPC ppc-vec-shift-be-le.f90 ppc-mma-outer-product-1.f90, flang/test/Lower/PowerPC ppc-mma-outer-product-1.f90

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+2,569-0llvm/test/CodeGen/AMDGPU/redundant-and.mir
+0-2,191llvm/test/CodeGen/AMDGPU/high-bits-zeroed-16-bit-ops.mir
+0-1,763llvm/test/Analysis/CostModel/RISCV/cast.ll
+1,709-0flang/test/Integration/PowerPC/ppc-mma-outer-product-1.f90
+0-1,701flang/test/Lower/PowerPC/ppc-mma-outer-product-1.f90
+1,420-0flang/test/Integration/PowerPC/ppc-vec-shift-be-le.f90
+5,698-5,655996 files not shown
+35,764-30,6451,002 files

LLVM/project 10a1fe8llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-whole-wave-functions.mir regbankselect-mad_64_32.mir, llvm/test/CodeGen/X86/GlobalISel regbankselect-x87.ll

[GISel] Rename regbankselect reg-bank-select

To be more consistent with other pass names, use hypens between the
words. Noticed this when I went to do a NewPM porting.

Reviewers: aeubanks, arsenm, vikramRH

Pull Request: https://github.com/llvm/llvm-project/pull/217486
DeltaFile
+4-4llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-icmp.mir
+4-4llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-copy.mir
+4-4llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-amdgcn.else.32.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-whole-wave-functions.mir
+3-3llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-mad_64_32.mir
+2-2llvm/test/CodeGen/X86/GlobalISel/regbankselect-x87.ll
+20-20198 files not shown
+266-266204 files

LLVM/project 5fff9d0clang/include/clang/Basic BuiltinsAMDGPUDocs.td BuiltinsAMDGPU.td, llvm/include/llvm/IR IntrinsicsAMDGPU.td

[NFC][AMDGPU] Introduce a new target feature for N=16 WMMAs
DeltaFile
+30-28llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+28-28clang/include/clang/Basic/BuiltinsAMDGPU.td
+20-0clang/include/clang/Basic/BuiltinsAMDGPUDocs.td
+10-5llvm/lib/Target/AMDGPU/VOP3PInstructions.td
+7-1llvm/lib/Target/AMDGPU/AMDGPU.td
+95-625 files

LLVM/project 5298e75llvm/lib/CodeGen/GlobalISel GISelValueTracking.cpp, llvm/test/CodeGen/AArch64 extract-subvec-combine.ll

[GlobalISel] Add G_EXTRACT_SUBVECTOR to computeNumSignBits (#216798)

Port the SDAG EXTRACT_SUBVECTOR computeNumSignBits handling to
GlobalISel. Offsets the demanded elements by the subvector index to
propagate sign bits from the source vector to the extracted subvector.
For scalable vectors, conservatively demands all elements.

Part of #150515.
DeltaFile
+51-0llvm/test/CodeGen/AArch64/GlobalISel/knownbits-extract-subvector.mir
+10-25llvm/test/CodeGen/AArch64/extract-subvec-combine.ll
+14-0llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+75-253 files

LLVM/project 4787504clang/lib/CIR/CodeGen CIRGenBuiltinAArch64.cpp, clang/test/CodeGen/AArch64 poly64.c neon-vget.c

[CIR][AArch64] Lower NEON set vector lane intrinsics (#217198)

### summary

part of : https://github.com/llvm/llvm-project/issues/185382

Lower all intrinsics in
https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#set-vector-lane

Assisted by : DeepSeek V4 Pro Max
DeltaFile
+312-0clang/test/CodeGen/AArch64/neon/getset.c
+0-195clang/test/CodeGen/AArch64/neon-vget.c
+1-24clang/test/CodeGen/AArch64/fp8-intrinsics/acle_neon_fp8_untyped.c
+0-20clang/test/CodeGen/AArch64/poly64.c
+5-5clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+318-2445 files

LLVM/project 140fe20llvm/include/llvm/Target TargetMachine.h, llvm/lib/CodeGen MachineModuleInfo.cpp

TargetMachine: Verify option/module-flag consistency once per module

The -target-abi option / "target-abi" module flag conflict was reported from
the per-function getSubtargetImpl in RISCV and LoongArch, so a module with
multiple subtargets would repeatedly diagnose. Introduce a new TargetMachine
method to validate the module for the global options.

I wasn't sure the best place to actually perform this check. This is now
performing it in the earliest pass in codegen, MachineModuleInfo.
MachineModuleInfo is a glorified map from IR to MachineFunction, so I'm not
sure this is the right place. The other alternative I started with was the
AsmPrinter initialization.

Ideally we would eliminate the global options. In particular target-abi is
going to be a bit sticky, because it lives in MCOptions and is thus used by
non-codegen contexts which won't have an IR module to read a flag from.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+14-10llvm/lib/Target/TargetMachine.cpp
+24-0llvm/test/CodeGen/RISCV/module-target-abi-conflict.ll
+8-3llvm/include/llvm/Target/TargetMachine.h
+2-0llvm/lib/CodeGen/MachineModuleInfo.cpp
+48-134 files

LLVM/project 1171007llvm/lib/Target/AMDGPU SIRegisterInfo.cpp, llvm/test/CodeGen/AMDGPU materialize-frame-index-sgpr.gfx10.ll frame-index.mir

[AMDGPU] Fix eliminateFrameIndex clobbering a scavenged register (#217470)

Writing the offset into an undefined scavenged register let the
scavenger alias it with another temp and corrupt the address
DeltaFile
+200-8llvm/test/CodeGen/AMDGPU/eliminate-frame-index-s-mov-b32.mir
+14-14llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+8-8llvm/test/CodeGen/AMDGPU/materialize-frame-index-sgpr.gfx10.ll
+8-8llvm/test/CodeGen/AMDGPU/frame-index.mir
+230-384 files