LLVM/project 7d71bc3llvm/docs/GlobalISel KnownBits.rst

[GlobalISel][Docs] Fix known-bits example and code snippet in KnownBits.rst (#213090)

- The simplified example annotates `%5 = G_CONSTANT i32 0x0F0` with the
value `0x00000FF0` (from %1 line); correct value is `0x000000F0`.
- `GISelValueTrackingAnalysisLegacy::get(MF)` returns a reference, so
call should be `VT.getKnownBits(...)` not `VT->getKnownBits(...)`.
- `KnownBits` members are `Zero` and `One`, not `Zeros`; use
`Known.Zero[0]` to test bit 0.
DeltaFile
+3-3llvm/docs/GlobalISel/KnownBits.rst
+3-31 files

LLVM/project 0e6a862orc-rt/include/orc-rt-c Logging.h, orc-rt/lib/executor Logging.cpp Session.cpp

[orc-rt] Add Session log category, Session object logging (#215963)

Adds a Session category to the ORC_RT_LOG system, and log messages to
key Session operations (construction, detach & disconnect, shutdown, and
destruction).
DeltaFile
+15-1orc-rt/lib/executor/Session.cpp
+1-1orc-rt/lib/executor/Logging.cpp
+1-0orc-rt/include/orc-rt-c/Logging.h
+17-23 files

LLVM/project 00cc5acpolly/lib/CodeGen IslNodeBuilder.cpp, polly/test/CodeGen iv_narrow_32bit_target.ll

[Polly] Narrow IV to lower type when possible (#212708)

This patch tries to lower the LLVM-IR type of IVs which are set to i64
by default during polly codegen. This is specially beneficial for
Hexagon as it uses Hardware Loops which requires 32 bit wide IVs.

---------

Co-authored-by: Anilava Kundu <anilkund at hu-anilkund-blr.qualcomm.com>
Co-authored-by: Santanu Das <santdas at qti.qualcomm.com>
DeltaFile
+77-0polly/test/CodeGen/iv_narrow_32bit_target.ll
+54-12polly/lib/CodeGen/IslNodeBuilder.cpp
+12-8polly/test/CodeGen/MemAccess/codegen_simple_md_float.ll
+12-8polly/test/CodeGen/MemAccess/codegen_simple_md.ll
+2-2polly/test/ScopInfo/int2ptr_ptr2int_2.ll
+2-2polly/test/ScopInfo/int2ptr_ptr2int.ll
+159-326 files

LLVM/project 0b4cdc1openmp/runtime/src kmp_traits.h

[libomp] Fix debug build after #176164

Fixes https://github.com/llvm/llvm-project/issues/215937.
DeltaFile
+13-2openmp/runtime/src/kmp_traits.h
+13-21 files

LLVM/project 1183eacllvm/lib/Target/LoongArch LoongArchISelLowering.cpp, llvm/test/CodeGen/LoongArch/lasx vec-extract-brcond.ll

[LoongArch] Fold shifted vector extract comparisons

Fold comparisons of the form:

  (shl (extract_vector_elt X, I), GRLen - EleBits) ==/!= 0

into:

  (extract_vector_elt X, I) ==/!= 0

When the shift amount equals `GRLen - EleBits`, the left shift only moves
the extracted element into the most significant bits without affecting
whether the value is zero. This canonicalization exposes
EXTRACT_VECTOR_ELT to later combines and enables selecting
VPICKVE2GR_* instructions directly.
DeltaFile
+12-27llvm/test/CodeGen/LoongArch/lsx/vec-extract-brcond.ll
+12-27llvm/test/CodeGen/LoongArch/lasx/vec-extract-brcond.ll
+17-0llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
+41-543 files

LLVM/project 0cee548llvm/lib/Transforms/Utils ScalarEvolutionExpander.cpp, llvm/test/Transforms/LoopStrengthReduce/X86 scev-vector-shl-crash.ll

[SCEV][SCEVExpander] Avoid querying SCEV for non-SCEVable instructions (#214902)

`getStrengthenedNoWrapFlagsFromBinOp()` expects instructions with
SCEVable operands.
For non-SCEVable vector-typed operands, this triggers the assertion in
`getSCEV()`.

This PR guards the caller in
`dropPoisonGeneratingAnnotationsAndReinfer()` so that
nowrap flags are only re-inferred for SCEVable instructions.

The added test is a crash regression test.

Fixes #214782
Fixes #215251
Fixes #114029
DeltaFile
+39-0llvm/test/Transforms/LoopStrengthReduce/X86/scev-vector-shl-crash.ll
+8-7llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+47-72 files

LLVM/project 8ffe338llvm/test/CodeGen/LoongArch/lasx vec-extract-brcond.ll, llvm/test/CodeGen/LoongArch/lsx vec-extract-brcond.ll

[LoongArch][NFC] Add tests for vector extract comparison combines (#214203)
DeltaFile
+137-0llvm/test/CodeGen/LoongArch/lsx/vec-extract-brcond.ll
+137-0llvm/test/CodeGen/LoongArch/lasx/vec-extract-brcond.ll
+274-02 files

LLVM/project 6651a11llvm/lib/Target/Lanai LanaiTargetMachine.h, llvm/test/CodeGen/Lanai subword.ll sub-cmp-peephole.ll

[Lanai] Default to NewPM

Lanai should be fully functional with the NewPM, so try defaulting to
it. Also remove the now duplicate test coverage.

Setting this flag makes both clang and llc default to the NewPM.

Reviewers: jpienaar

Pull Request: https://github.com/llvm/llvm-project/pull/214574
DeltaFile
+0-4llvm/test/CodeGen/Lanai/codemodel.ll
+0-3llvm/test/CodeGen/Lanai/mem_alu_combiner.ll
+0-3llvm/test/CodeGen/Lanai/delay_filler.ll
+2-0llvm/lib/Target/Lanai/LanaiTargetMachine.h
+0-1llvm/test/CodeGen/Lanai/subword.ll
+0-1llvm/test/CodeGen/Lanai/sub-cmp-peephole.ll
+2-1219 files not shown
+2-3125 files

LLVM/project 3526b35llvm/include/llvm/CodeGen TargetSubtargetInfo.h, llvm/lib/CodeGen RegisterClassInfo.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+19-0mlir/lib/Dialect/ArmSME/IR/ArmSME.cpp
+10-5llvm/lib/Target/ARM/ARMSubtarget.cpp
+7-7llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
+5-8llvm/lib/CodeGen/RegisterClassInfo.cpp
+6-2mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
+6-2mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
+53-246 files not shown
+64-3112 files

LLVM/project 0c4f374llvm/lib/Target/MSP430 MSP430TargetMachine.h

[MSP430] Default to NewPM

MSP430 should be fully complete with the NewPM, so default to it.

This flag makes both clang and llc default to using the NewPM for
CodeGen.

Reviewers: asl

Pull Request: https://github.com/llvm/llvm-project/pull/214573
DeltaFile
+2-0llvm/lib/Target/MSP430/MSP430TargetMachine.h
+2-01 files

LLVM/project 2a4cb1fmlir/include/mlir/Dialect/ArmSME/IR ArmSMEOps.td, mlir/lib/Dialect/ArmSME/IR ArmSME.cpp

[mlir][ArmSME] Reject non-unit-stride `tile_load/tile_store` memrefs and pass `layout{IdentityLayoutMap}` to matmul tests (#214959)
DeltaFile
+19-0mlir/lib/Dialect/ArmSME/IR/ArmSME.cpp
+6-2mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/multi-tile-matmul-mixed-types.mlir
+6-2mlir/test/Integration/Dialect/Linalg/CPU/ArmSME/matmul.mlir
+2-0mlir/include/mlir/Dialect/ArmSME/IR/ArmSMEOps.td
+33-44 files

LLVM/project d7610f8llvm/include/llvm/CodeGen TargetSubtargetInfo.h, llvm/lib/CodeGen RegisterClassInfo.cpp

[CodeGen] Avoid querying allocation order for every CSR alias (#215752)

Profiling tramp3d-v4 on aarch64-O0-g shows ~0.30% of compile-time is
spent in RegisterClassInfo::runOnMachineFunction.

It currently walks every alias of every callee-saved register for every
MachineFunction, doing a virtual call to ignoreCSRForAllocationOrder for
each alias. ARM is the only target that overrides this hook; all other
targets construct a full-sized BitVector and perform the alias traversal
only to fill it with zeroes.

Replace the per-register hook with a target-populated mask. Most targets
leave the mask empty, avoiding the allocation and alias traversal. The
mask is also only consulted after getLastCalleeSavedAlias confirms the
physical register aliases a CSR, so ARM can populate all GPR bits
directly without rediscovering the CSR aliases.

Improves CTMark geomean by -0.10%, with tramp3d-v4 -0.34%.


    [2 lines not shown]
DeltaFile
+10-5llvm/lib/Target/ARM/ARMSubtarget.cpp
+7-7llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
+5-8llvm/lib/CodeGen/RegisterClassInfo.cpp
+2-2llvm/lib/Target/ARM/ARMSubtarget.h
+24-224 files

LLVM/project 1366911llvm/utils/gn/secondary/llvm/unittests/CodeGen BUILD.gn

[gn build] Port ff494c648aec (#215956)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/unittests/CodeGen/BUILD.gn
+1-01 files

LLVM/project e90f591llvm/utils/gn/secondary/clang/lib/Headers BUILD.gn

[gn build] Port c3792d66d2c1 (#215955)
DeltaFile
+3-0llvm/utils/gn/secondary/clang/lib/Headers/BUILD.gn
+3-01 files

LLVM/project 087eff5llvm/utils/gn/secondary/llvm/unittests/ADT BUILD.gn

[gn build] Port 1e798c1343fa (#215954)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/unittests/ADT/BUILD.gn
+1-01 files

LLVM/project f9af10cllvm/utils/gn/secondary/llvm/tools/libCASPluginTest BUILD.gn

[gn] Attempt to get CASTests passing after #214856 (#215949)

See also
https://github.com/llvm/llvm-project/pull/213331#discussion_r3772630039
DeltaFile
+2-5llvm/utils/gn/secondary/llvm/tools/libCASPluginTest/BUILD.gn
+2-51 files

LLVM/project 4b59bc2llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.cpp

[SandboxVectorizer] Dispatch LoadStoreVec::runOnRegion on seed kind

runOnRegion() previously assumed its seed slice was always a store chain,
unconditionally casting Bndl[0] to StoreInst. This crashed (assertion in
areConsecutive<StoreInst>) whenever -sbvec-collect-seeds included "loads",
since a load-seeded region's Aux holds LoadInsts.

Add a symmetric top-level path for load-kind seed slices: createVectorLoad()
builds the vector load, and vectorizeLoads() -- unlike a load that merely
feeds a store -- has to handle arbitrary uses, so it replaces each original
load with an extract from the vector load (VecUtils::unpack()) rather than
just discarding it. runOnRegion() determines the seed kind from Bndl[0]
(asserting the slice is homogeneous, which SeedCollection guarantees) and
dispatches to vectorizeStores()/vectorizeLoads() accordingly.

No sub-run search yet: vectorizeStores()/vectorizeLoads() are each still
tried once over the whole seed slice, same as before this commit for
stores. Sub-bundle partitioning for both kinds is a separate follow-up.


    [13 lines not shown]
DeltaFile
+96-17llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+99-0llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec_load_seeds.ll
+24-2llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+219-193 files

LLVM/project d28009cflang/lib/Lower/OpenMP OpenMP.cpp, lldb/source/Symbol Symbol.cpp

rebase

Created using spr 1.3.7
DeltaFile
+699-0llvm/test/Transforms/ConstraintElimination/header-induction-start-bounds.ll
+70-324llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+47-285flang/lib/Lower/OpenMP/OpenMP.cpp
+315-0llvm/test/Transforms/CorrelatedValuePropagation/infer-nowrap-from-uses.ll
+206-89lldb/source/Symbol/Symbol.cpp
+138-138llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+1,475-836366 files not shown
+5,877-3,167372 files

LLVM/project b61e59fflang/lib/Lower/OpenMP OpenMP.cpp, lldb/source/Symbol Symbol.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+699-0llvm/test/Transforms/ConstraintElimination/header-induction-start-bounds.ll
+70-324llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+47-285flang/lib/Lower/OpenMP/OpenMP.cpp
+315-0llvm/test/Transforms/CorrelatedValuePropagation/infer-nowrap-from-uses.ll
+206-89lldb/source/Symbol/Symbol.cpp
+138-138llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+1,475-836366 files not shown
+5,877-3,167372 files

LLVM/project 2346b8dflang/lib/Lower/OpenMP OpenMP.cpp, lldb/source/Symbol Symbol.cpp

rebase

Created using spr 1.3.7
DeltaFile
+699-0llvm/test/Transforms/ConstraintElimination/header-induction-start-bounds.ll
+70-324llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+47-285flang/lib/Lower/OpenMP/OpenMP.cpp
+315-0llvm/test/Transforms/CorrelatedValuePropagation/infer-nowrap-from-uses.ll
+206-89lldb/source/Symbol/Symbol.cpp
+138-138llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+1,475-836366 files not shown
+5,877-3,167372 files

LLVM/project e600482flang/lib/Lower/OpenMP OpenMP.cpp, lldb/source/Symbol Symbol.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+699-0llvm/test/Transforms/ConstraintElimination/header-induction-start-bounds.ll
+70-324llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+47-285flang/lib/Lower/OpenMP/OpenMP.cpp
+315-0llvm/test/Transforms/CorrelatedValuePropagation/infer-nowrap-from-uses.ll
+206-89lldb/source/Symbol/Symbol.cpp
+138-138llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+1,475-836366 files not shown
+5,877-3,167372 files

LLVM/project a025709llvm/tools/llc llc.cpp

[llc] Respect shouldDefaultToNewPM

This makes llc respect the new TM flag that allows targets to opt in to
defaulting to the NewPM.

Reviewers: vikramRH, aengelke, arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/214572
DeltaFile
+9-1llvm/tools/llc/llc.cpp
+9-11 files

LLVM/project 44176c4flang/lib/Lower/OpenMP OpenMP.cpp, lldb/source/Symbol Symbol.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+699-0llvm/test/Transforms/ConstraintElimination/header-induction-start-bounds.ll
+70-324llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+47-285flang/lib/Lower/OpenMP/OpenMP.cpp
+315-0llvm/test/Transforms/CorrelatedValuePropagation/infer-nowrap-from-uses.ll
+206-89lldb/source/Symbol/Symbol.cpp
+138-138llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+1,475-836366 files not shown
+5,877-3,167372 files

LLVM/project 290a0a1clang/include/clang/Basic CodeGenOptions.def CodeGenOptions.h, clang/include/clang/Options Options.td

[Clang] Make NewPM switch respect shouldDefaultToNewPM

shouldDefaultToNewPM is a new target flag that allows targets to specify
that the NewPM should be used by default for compilation. Wire it up
into clang.

Reviewers: arsenm, efriedma-quic, jansvoboda11

Pull Request: https://github.com/llvm/llvm-project/pull/214571
DeltaFile
+8-0clang/include/clang/Options/Options.td
+5-1clang/lib/CodeGen/BackendUtil.cpp
+6-0clang/include/clang/Basic/CodeGenOptions.h
+2-1clang/include/clang/Basic/CodeGenOptions.def
+1-1clang/test/CodeGen/X86/newpm.c
+22-35 files

LLVM/project 34e8b1bflang/lib/Lower/OpenMP OpenMP.cpp, llvm/lib/CodeGen/SelectionDAG LegalizeFloatTypes.cpp

[𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.7

[skip ci]
DeltaFile
+699-0llvm/test/Transforms/ConstraintElimination/header-induction-start-bounds.ll
+70-324llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+47-285flang/lib/Lower/OpenMP/OpenMP.cpp
+315-0llvm/test/Transforms/CorrelatedValuePropagation/infer-nowrap-from-uses.ll
+138-138llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+161-78llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
+1,430-825254 files not shown
+3,595-2,432260 files

LLVM/project 47cc2f4llvm/lib/Object GOFFObjectFile.cpp

Address comments in GOFFObjectFile.cpp
DeltaFile
+18-19llvm/lib/Object/GOFFObjectFile.cpp
+18-191 files

LLVM/project d94d03dllvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV rvp-simd-64.ll

[RISCV][P-ext] Select scalar mulhr/mulhru/mulhrsu for RV32 v2i32 (#215938)

The `combinePExtTruncate` DAGCombine bailed out on RV32 for both
`v4i16` and `v2i32` 64-bit packed types. The `v4i16` case is correct
(no paired rounding multiply-high for 16-bit lanes), but `v2i32` was
incorrectly excluded.

RV32 provides scalar `mulhr`/`mulhru`/`mulhrsu` instructions. Since
`v2i32` on RV32 is a GPRPair, splitting into two scalar operations in
the combine — while the widening multiply shape is still visible —
reuses those instructions directly.

The non-rounding forms (`mulh`/`mulhu`/`mulhsu`) already scalarize
correctly through the generic legalizer, so only the rounding case
needs explicit handling here.
DeltaFile
+8-24llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+16-1llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+24-252 files

LLVM/project 69f8a33llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.cpp

[SandboxVectorizer] Vectorize partial store sub-bundles in LoadStoreVec

runOnRegion() previously required an entire store seed chain to vectorize
as one unit. A seed slice can legitimately fail that as a whole while a
sub-run within it is still fine, e.g. because it spans an address gap
(SeedBundle::getSlice sorts by address but doesn't guarantee contiguity)
or a sub-range fails to schedule. Add findLegalStoreRun()/isLegalStoreRun()
to search for the longest vectorizable run starting at a given position,
and have runOnRegion() call vectorizeStores() once per such run instead of
once for the whole chain. isLegalStoreRun() is purely an address/scheduling
check now -- no operand-eligibility check is needed since packOperands()
accepts any operand kind.

The search only ever shrinks a candidate length, never grows one:
Scheduler::trySchedule() permanently commits a successful multi-instruction
bundle (a later request that overlaps it and is not an exact match returns
AlreadyScheduled and fails), so starting from the longest candidate and
shrinking on failure is the only search order compatible with the
scheduler's contract.

    [18 lines not shown]
DeltaFile
+53-3llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+45-0llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec.ll
+19-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+0-7llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec_load_seeds.ll
+117-104 files

LLVM/project 1ac0a76libcxx/include CMakeLists.txt, llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn] port 273706151fa625 (#215947)
DeltaFile
+1-1libcxx/include/CMakeLists.txt
+1-0llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+2-12 files

LLVM/project 18eaec2llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.cpp

[SandboxVectorizer] Make LoadStoreVec::vectorizeStores direction-agnostic

Remove the AllLoads/AllConstants operand-kind gate: vectorizeStores() no
longer requires a store chain's value operands to be all loads, all
constants, or neither. Instead it always builds the vector value via
packOperands(), which packs any mix of loads, constants, or arbitrary SSA
values via extractelement/insertelement -- direction-agnostic in the sense
that it doesn't care what kind of operand it's given, unlike the
load-specific and constant-specific paths it replaces.

vectorizeLoads()/createVectorLoad(), added by the previous commit for
load-kind seed slices, are unaffected: packOperands() only replaces
vectorizeStores()'s old all-loads fast path, which duplicated the same
vector-load construction createVectorLoad() already does.

Update load_store_vec.ll, load_store_vec_mixed_types.ll, and
AMDGPU/basic.ll for the new pack-based codegen.

check-llvm Transforms/SandboxVectorizer passes (31/31).
DeltaFile
+114-36llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec_mixed_types.ll
+116-32llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/load_store_vec.ll
+13-99llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+6-2llvm/test/Transforms/SandboxVectorizer/Passes/LoadStoreVec/AMDGPU/basic.ll
+5-2llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+254-1715 files