LLVM/project bbedf74llvm/lib/Transforms/InstCombine InstCombineCalls.cpp, llvm/test/Transforms/InstCombine ucmp.ll scmp.ll

[InstCombine] Fold scmp/ucmp of extended operands (#218871)

Fixes #202467

`scmp`/`ucmp` compare their operands, and both `sext` and `zext` are
monotonic with respect to the unsigned order (`sext` additionally
preserves the signed order). So a common extension on both operands can
be dropped and the compare done in the narrower type:

scmp (sext X), (sext Y) --> scmp X, Y
scmp (zext X), (zext Y) --> ucmp X, Y
ucmp (ext X),  (ext Y)  --> ucmp X, Y

Zero-extended values are non-negative, which is why a signed compare of
them becomes an unsigned compare of the narrow operands.

Both operands must use the same extend opcode and source type. Since
these intrinsics are not commutative, the extend is looked for on either
side, and a constant operand is narrowed instead when truncating and

    [4 lines not shown]
DeltaFile
+178-0llvm/test/Transforms/InstCombine/scmp.ll
+149-0llvm/test/Transforms/InstCombine/ucmp.ll
+62-1llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+389-13 files

LLVM/project d32b9b4llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.cluster.load.async.to.lds.ll llvm.amdgcn.cluster.load.ll

[AMDGPU] Downgrade cluster loads in strict mode
DeltaFile
+703-168llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cluster.load.ll
+527-71llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cluster.load.async.to.lds.ll
+26-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+1,256-2393 files

LLVM/project f099c5fllvm/utils/gn/secondary/clang/unittests/AST BUILD.gn, llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn build] Port commits (#219009)

13967c20b334
a2ac4f6af958
a4fccdb6242c
c632208d6bfe
DeltaFile
+4-1llvm/utils/gn/secondary/llvm/unittests/ABI/BUILD.gn
+1-1llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+2-0llvm/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn
+1-0llvm/utils/gn/secondary/clang/unittests/AST/BUILD.gn
+8-24 files

LLVM/project b898ae2llvm/lib/Transforms/Vectorize VPlanConstruction.cpp, llvm/test/Transforms/LoopVectorize select-smax-last-index.ll

[VPlan] Reject Argmin/Argmax with intermediate ops. (#218944)

handleMultiUseReductions currently only supports a single min/max
reduction step, not multiple intermediate ops.

Bail out instead of crashing in that case.

PR: https://github.com/llvm/llvm-project/pull/218944
DeltaFile
+44-0llvm/test/Transforms/LoopVectorize/select-smax-last-index.ll
+9-4llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+53-42 files

LLVM/project 90a5ddflldb/source/Plugins/SymbolFile/NativePDB UdtRecordCompleter.h UdtRecordCompleter.cpp, lldb/unittests/SymbolFile/NativePDB UdtRecordCompleterTests.cpp

[lldb][NativePDB] Keep declaration order of struct fields (#218731)

Unlike in C/C++, struct fields in Rust may be reordered by the compiler
to reduce padding. When completing records, we only tracked the offset
of fields inside the struct. For Rust this could result in an order that
didn't match the declaration (#218613).

This PR tracks the declaration order and sorts fields after the record
is constructed. It's assumed that the members inside the `LF_FIELDLIST`
are present in declaration order.

Fixes #218613.
DeltaFile
+43-9lldb/unittests/SymbolFile/NativePDB/UdtRecordCompleterTests.cpp
+27-4lldb/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp
+16-4lldb/source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.h
+86-173 files

LLVM/project d16983amlir/lib/Dialect/LLVMIR/Transforms InlinerInterfaceImpl.cpp, mlir/test/Dialect/LLVMIR inlining-alias-scopes.mlir

[mlir][LLVM] Use a disjoint scope domain when inlining noalias

This matches recent changes to the LLVM inliner.

AI disclosure: Claude wrote the code, I wrote the commit message and
have done initial review.
DeltaFile
+28-25mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+10-18mlir/test/Dialect/LLVMIR/inlining-alias-scopes.mlir
+38-432 files

LLVM/project e229e73mlir/include/mlir/Dialect/LLVMIR LLVMAttrDefs.td, mlir/lib/Dialect/LLVMIR/Transforms InlinerInterfaceImpl.cpp

[mlir][LLVM] Add disjointScopes to AliasScopeDomainAttr

This also updates the MLIR-side inliner to clone disjoint domains
while cloning alias scopes, matching changes to LLVM.

AI disclosure: Claude wrote the code, I wrote the commit message and
looked at the code.
DeltaFile
+25-0mlir/test/Target/LLVMIR/Import/metadata-alias-scopes.ll
+23-0mlir/test/Target/LLVMIR/attribute-alias-scopes.mlir
+17-2mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
+4-2mlir/lib/Target/LLVMIR/ModuleImport.cpp
+4-1mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+2-2mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+75-76 files

LLVM/project 0579a5cllvm/lib/Target/AMDGPU AMDGPULowerModuleLDSPass.cpp, llvm/test/CodeGen/AMDGPU lower-lds-struct-aa-memcpy.ll remove-no-kernel-id-attribute.ll

[AMDGPU] Use a disjoint scope domain for merged LDS structs

When lowering LDS values, all the values are mutually disjoint, so we
can use the newly-added disjoint scopes feature to simplify the IR.

AI disclosure: Claude wrote this and I reviewed it and wrote the
 commit message
DeltaFile
+15-52llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
+35-10llvm/test/CodeGen/AMDGPU/lower-module-lds-precise-allocate-to-module-struct.ll
+15-18llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa.ll
+11-13llvm/test/CodeGen/AMDGPU/lower-module-lds-via-hybrid.ll
+8-12llvm/test/CodeGen/AMDGPU/remove-no-kernel-id-attribute.ll
+9-10llvm/test/CodeGen/AMDGPU/lower-lds-struct-aa-memcpy.ll
+93-1156 files not shown
+139-16112 files

LLVM/project 732b9f9llvm/lib/Target/AMDGPU AMDGPULowerKernelArguments.cpp, llvm/test/CodeGen/AMDGPU lower-kernargs.ll si-split-load-store-alias-info.ll

[AMDGPU] Use a disjoint scope domain for noalias kernel arguments

All noalias arguments of a kernel are disjoint with each other, so we
can use a disjoint scope to save on metadata construction.

AI disclosure: Claude wrote this, I looked at it and wrote this
message.
DeltaFile
+53-64llvm/test/CodeGen/AMDGPU/lower-noalias-kernargs.ll
+20-13llvm/lib/Target/AMDGPU/AMDGPULowerKernelArguments.cpp
+11-11llvm/test/CodeGen/AMDGPU/lower-kernel-arguments-noalias-call-no-ptr-args.ll
+8-8llvm/test/CodeGen/AMDGPU/si-split-load-store-alias-info.ll
+4-4llvm/test/CodeGen/AMDGPU/lower-kernargs.ll
+96-1005 files

LLVM/project 4e35945clang/test/CodeGen arm-v8.2a-neon-intrinsics-generic.c arm_neon_intrinsics.c, llvm/lib/Transforms/Utils InlineFunction.cpp

[Inliner] Use a disjoint scope domain for noalias arguments

InlineFunction creates alias.scope/noalias metadata to represent the
set of `noalias` arguments to a function. We don't need the `!noalias`
now that we have the ability to use disjoint scopes, saving us IR size
and metadata bloat.

TODO move these to a previous commit.
Also changes InstCombine to not drop the experimental.noalias.scope.decl
for disjoint scopes even if they're not mentioned in a `!noalias`, but
do still delete them if they're not used.
DeltaFile
+324-324clang/test/CodeGen/arm_neon_intrinsics.c
+72-72clang/test/CodeGen/arm-v8.2a-neon-intrinsics-generic.c
+35-30llvm/lib/Transforms/Utils/InlineFunction.cpp
+13-14llvm/test/Transforms/Inline/noalias-calls2.ll
+12-12llvm/test/Transforms/Inline/noalias2.ll
+11-11llvm/test/Transforms/PhaseOrdering/pr39282.ll
+467-4639 files not shown
+487-48315 files

LLVM/project 404ddf7clang/test/CodeGen arm_neon_intrinsics.c arm-v8.2a-neon-intrinsics-generic.c, llvm/lib/Bitcode/Reader MetadataLoader.cpp

[IR] Add alias scope domains with disjoint scopes

See RFC at
https://discourse.llvm.org/t/rfc-disjoint-scope-alias-scope-noalias-domains/91537

This commit adds support for declaring an alias scope domain disjoint.
Disjoint domains are ones where each scope is implicitly `!noalias`
with each other scope in the domain. This is represented by adding an
`i1` into the scope's domain as the second argument, with `i1 true`
representing disjoint scopes and `i1 false` representing the old
non-disjoint behavior. AutoUpgrade mechanisms have been added to add
in the missing `i1 false` to existing metadata.

This commit updates alias analysis to know about disjoint scopes and
updates the function cloner to also clone the alias domain if it's
disjoint (since, as a herd of LLMs discovered, you don't want the old
IR to be noalias with a clone of itself).

Commits to migrate passes to use disjoint scopes where that's an

    [4 lines not shown]
DeltaFile
+72-72clang/test/CodeGen/arm-v8.2a-neon-intrinsics-generic.c
+54-54clang/test/CodeGen/arm_neon_intrinsics.c
+97-0llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+95-0llvm/test/Transforms/InstCombine/noalias-scope-decl-disjoint-domain.ll
+42-42llvm/test/Transforms/LoopUnroll/peel-loop-noalias-scope-decl.ll
+39-35llvm/test/CodeGen/MIR/AMDGPU/machine-metadata.mir
+399-203189 files not shown
+1,342-718195 files

LLVM/project 1d0aea7llvm/test/tools/UpdateTestChecks/update_test_checks dot_value_in_metadata_string.test, llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs dot_value_in_metadata_string.ll dot_value_in_metadata_string.ll.expected

[utils] Don't rename %. inside quoted strings in test checkseg

Replacing `%.foo` with `%dotfoo` everywhere also caught any `%.foo`
inside metadata, which would then cause incorrect CHECK lines to be
generated (since the value in the metedata isn't going to be
modified).

This commit fixes the issue by matching quoted strings in a regex
before looking for %. to replace.

AI disclosure: Claude found and fixed this, I wrote the commit message
DeltaFile
+22-0llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/dot_value_in_metadata_string.ll.expected
+10-1llvm/utils/UpdateTestChecks/common.py
+11-0llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/dot_value_in_metadata_string.ll
+7-0llvm/test/tools/UpdateTestChecks/update_test_checks/dot_value_in_metadata_string.test
+50-14 files

LLVM/project e348236llvm/test/tools/UpdateTestChecks/update_test_checks dot_value_in_metadata_string.test, llvm/utils/UpdateTestChecks common.py

A better fix
DeltaFile
+2-11llvm/utils/UpdateTestChecks/common.py
+3-0llvm/test/tools/UpdateTestChecks/update_test_checks/dot_value_in_metadata_string.test
+5-112 files

LLVM/project c79e63cflang/include/flang/Semantics openmp-utils.h, flang/lib/Semantics check-omp-structure.h check-omp-structure.cpp

[flang][OpenMP] Track reachable metadirective replacements

Semantic checks currently consider each statically applicable metadirective
replacement independently. This can diagnose lower-ranked replacements that
selection can never reach, and nested construct selectors cannot observe a
directive selected by an enclosing metadirective.

Use shared candidate ranking to retain only reachable replacements. Track each
effective directive path separately and propagate reachability to nested APPLY
transformations. This lets nested selectors observe selected contexts without
combining mutually exclusive paths.

Assisted with codex.
DeltaFile
+211-92flang/lib/Semantics/check-omp-variant.cpp
+79-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+54-24flang/lib/Semantics/check-omp-structure.cpp
+31-12flang/lib/Semantics/check-omp-structure.h
+23-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-apply.f90
+4-0flang/include/flang/Semantics/openmp-utils.h
+402-1281 files not shown
+403-1297 files

LLVM/project b3411b8llvm/docs ProgrammersManual.md, llvm/include/llvm/ADT FoldingSet.h

[FoldingSet] Switch to linear probing and Algorithm R deletion (#218190)

FoldingSet uses an inefficient chaining hash table. Switch to
linear-probing open addressing: the bucket array holds node pointers,
with null marking an empty slot. Deletion uses Knuth TAOCP 6.4 Algorithm
R, as DenseMap/StringMap do, so erase invalidates iterators while
leaving pointers to nodes valid.

The next-in-bucket pointer becomes a cached 32-bit hash, halving
FoldingSetNode. A probe compares it before the profile compare, and
FindNodeOrInsertPos returns it instead of a bucket address, so an
InsertPos survives intervening insertions.

https://discourse.llvm.org/t/rfc-modernizing-llvms-foldingset-open-addressing-with-swiss-table-and-algorithm-r/91637

LLM-aided

Co-authored-by: Kazu Hirata <kazu at google.com>
DeltaFile
+92-181llvm/lib/Support/FoldingSet.cpp
+54-56llvm/include/llvm/ADT/FoldingSet.h
+92-17llvm/unittests/ADT/FoldingSet.cpp
+5-4llvm/docs/ProgrammersManual.md
+243-2584 files

LLVM/project 4b809a2llvm/include/llvm/CodeGen MIRYamlMapping.h, llvm/lib/CodeGen/MIRParser MIRParser.cpp

Addressed review
DeltaFile
+3-3llvm/include/llvm/CodeGen/MIRYamlMapping.h
+3-2llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+1-1llvm/test/CodeGen/MIR/AMDGPU/register-allocation-antihints-mir-print-parse.mir
+7-63 files

LLVM/project 319e731clang/include/clang/AST ASTContext.h, clang/lib/AST ASTContext.cpp

[clang] Shrink AutoTypes map key to reduce peak memory (#218278)

While looking for memory regressions, I found that #118288 caused
[CTRE](https://github.com/hanickadot/compile-time-regular-expressions)
to regress by ~9.5% in peak memory (+758 MB).

The fix is simple: use a reference to the FoldingSetNodeID in the map.

| | Max RSS |
| --- | --- |
| trunk | 8928 MB |
| this PR | **8347 MB (−6.5%)** |

[compile-time-tracker](

https://llvm-compile-time-tracker.com/compare.php?from=49de424f45389cb757c3cc8c50daf38d024e2314&to=0cf6a242f9b5a211f9dffd6b8f52aeeb3e91e508&stat=instructions)
DeltaFile
+17-1clang/include/clang/AST/ASTContext.h
+2-2clang/lib/AST/ASTContext.cpp
+19-32 files

LLVM/project c6bdaballvm/include/llvm/IR DebugInfoMetadata.h, llvm/lib/CodeGen/AsmPrinter DwarfUnit.cpp

[DebugInfo] Add DW_TAG_property support to LLVM DebugInfo (#215776)

DWARF v6 adds DW_TAG_property to represent an entity accessed like a
data member but implemented via an accessor, such as an Objective-C
@property backed by an ivar. This adds a DIProperty metadata node,
plumbs it through the IR (LLParser/AsmWriter, bitcode, DIBuilder,
Verifier), and emits DW_TAG_property/DW_AT_property_forward DIEs in
DwarfUnit, anchored on the accessor's own subprogram DIE.

This covers the LLVM IR and DWARF layers only; Clang emission and
LLDB consumption are left for follow-up patches.

Assisted-by: Claude
DeltaFile
+83-0llvm/include/llvm/IR/DebugInfoMetadata.h
+58-0llvm/test/DebugInfo/Generic/property.ll
+42-0llvm/unittests/IR/MetadataTest.cpp
+35-0llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+26-0llvm/lib/IR/LLVMContextImpl.h
+20-0llvm/test/Assembler/diproperty.ll
+264-020 files not shown
+435-126 files

LLVM/project 2a697daflang/lib/Optimizer/Transforms/CUDA CUFFunctionRewrite.cpp, flang/test/Fir/CUDA cuda-function-rewrite.mlir

[flang][cuda][NFC] Walk fir.call instead of greedy rewrite in CUFFunctionRewrite (#218513)

The pass only replaces on_device() calls with a constant. The greedy
pattern driver was extra work on every fir.call and also folded the
surrounding convert chain. Walk with IRRewriter instead, and check for
the i1 constant in the tests.

This reduce the footprint of the pass especially if there are many
fir.call ops.
DeltaFile
+13-23flang/lib/Optimizer/Transforms/CUDA/CUFFunctionRewrite.cpp
+20-10flang/test/Fir/CUDA/cuda-function-rewrite.mlir
+33-332 files

LLVM/project aca37b4llvm/lib/Target/AMDGPU SILoadStoreOptimizer.cpp AMDGPU.td, llvm/test/CodeGen/AMDGPU ds_write2.ll ds_read2-gfx1250.ll

[AMDGPU] Disable unaligned 2addr LDS operations in strict mode
DeltaFile
+326-161llvm/test/CodeGen/AMDGPU/ds_read2-gfx1250.ll
+149-75llvm/test/CodeGen/AMDGPU/ds_write2.ll
+12-2llvm/lib/Target/AMDGPU/DSInstructions.td
+8-0llvm/lib/Target/AMDGPU/AMDGPU.td
+6-1llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+501-2395 files

LLVM/project 226061bllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 reassoc-copyable-in-another-entry.ll

[SLP]Fix unscheduled-deps assertion for reassoc scalars covered by another entry's copyable data

The scheduler's reassociated-operand cleanup released the dependency
through copyable data of any entry's edge, so a dep registered for an
uncovered entry could go unreleased.

Fixes: #218850

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/219010
DeltaFile
+76-0llvm/test/Transforms/SLPVectorizer/X86/reassoc-copyable-in-another-entry.ll
+16-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+92-22 files

LLVM/project 9131e72llvm/test/Analysis/CostModel/AArch64 fround-bf16.ll sve-fround.ll

[AArch64] Add cost tests for round intrinsics. NFC (#219008)
DeltaFile
+367-0llvm/test/Analysis/CostModel/AArch64/fround.ll
+316-0llvm/test/Analysis/CostModel/AArch64/sve-fround.ll
+127-0llvm/test/Analysis/CostModel/AArch64/fround-bf16.ll
+810-03 files

LLVM/project 9b9d90cclang/docs ReleaseNotes.md, clang/lib/CodeGen CGDecl.cpp

[Clang][CodeGen] Fix crash in EmitParmDecl for bodyless destructors with -fextend-variable-liveness (#218830)

The fake-use coroutine check in EmitParmDecl calls
FnDecl->getBody()->getStmtClass() without guarding against a null
getBody(). This crashes when processing implicit parameters (e.g.
should_call_delete) of MSVC deleting destructors whose base destructor
is only declared, not defined.
DeltaFile
+17-0clang/test/CodeGen/fake-use-msvc-dtor.cpp
+1-1clang/lib/CodeGen/CGDecl.cpp
+1-0clang/docs/ReleaseNotes.md
+19-13 files

LLVM/project d8f73ceutils/bazel MODULE.bazel.lock, utils/bazel/llvm-project-overlay/libc libc_build_rules.bzl

[libc][bazel] Add targets for startup objects

[libc][bazel] more startup object rules

[libc][bazel] Refactor internal_copts for libc_support_library
DeltaFile
+202-0utils/bazel/llvm-project-overlay/libc/startup/startup_rules.bzl
+104-0utils/bazel/llvm-project-overlay/libc/startup/linux/BUILD.bazel
+46-0utils/bazel/llvm-project-overlay/libc/startup/linux/x86_64/BUILD.bazel
+41-2utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+3-0utils/bazel/llvm-project-overlay/libc/startup/BUILD.bazel
+1-1utils/bazel/MODULE.bazel.lock
+397-32 files not shown
+399-48 files

LLVM/project ab2c34bllvm/docs AMDGPUUsage.rst

[AMDGPU] Document gfx1250-strict. NFC
DeltaFile
+12-0llvm/docs/AMDGPUUsage.rst
+12-01 files

LLVM/project d61b93eclang/docs/analyzer checkers.md, clang/include/clang/StaticAnalyzer/Checkers Checkers.td

[clang][docs] Add documentation for the DanglingPtrDeref checker (#216688)

In order to move the `DanglingPtrDeref` checker out of alpha it needs a
documentation the user can get information from. This PR added the
documentation for the `DanglingPtrDeref` checker and follow up PR will
also do the same for the `UseAfterLifetimeEnd` checker. Currently the
documentation sits in the `alpha.core` category, but once we move the
checker out of alpha stage it should be changed as well.

AI-policy: After I have written the documentation I verified my
spellings, grammar with AI.
DeltaFile
+59-0clang/docs/analyzer/checkers.md
+1-1clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+60-12 files

LLVM/project 179b292utils/bazel/llvm-project-overlay/libc libc_configure_options.bzl BUILD.bazel

[libc][bazel] Allow building with -DLIBC_FULL_BUILD

This PR defines a flag `--@llvm-project//libc:build_mode` that configures LLVM-libc to build with full-build flags. This is only compatible with clang at the moment, since it relies on the `-nostdlibinc` flag.
DeltaFile
+39-4utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl
+22-5utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
+22-5utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+83-143 files

LLVM/project c39d2fclibc/src/signal/linux kill.cpp __restore.cpp, libc/src/stdlib atexit.cpp at_quick_exit.cpp

[libc][bazel] Make a large swath of targets full-build compatible
DeltaFile
+1,412-45utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+1-2libc/src/signal/linux/__restore.cpp
+2-1libc/src/stdlib/atexit.cpp
+2-1libc/src/stdlib/at_quick_exit.cpp
+0-1libc/src/signal/linux/kill.cpp
+1,417-505 files

LLVM/project 229a6dfutils/bazel MODULE.bazel extensions.bzl

[libc][bazel] Add a repo with linux kernel UAPI headers

This will be used to support libc's -DFULL_BUILD option, which uses `-nostdlibinc` and thus requires a copy of linux kernel headers.
DeltaFile
+74-0utils/bazel/linux_uapi.bzl
+5-1utils/bazel/MODULE.bazel.lock
+2-0utils/bazel/extensions.bzl
+1-0utils/bazel/MODULE.bazel
+82-14 files

LLVM/project ca7de35llvm/lib/Transforms/Vectorize VectorCombine.cpp, llvm/test/Transforms/VectorCombine ext-extract-oob.ll

[VectorCombine] Reject out-of-bounds extract indexes in scalarizeExtExtract (#218984)

Fixes #218724.

An out-of-bounds `extractelement` produces poison in LLVM IR.
`VectorCombine::scalarizeExtExtract` currently matches constant-index
extracts without checking that the index is within the vector bounds.

For a sufficiently large out-of-bounds index, `scalarizeExtExtract` uses
the index to compute a shift amount for the packed integer
representation. The resulting constant can exceed the bitwidth of the
packed type, causing an `APInt` assertion in `ConstantInt::get`.

This patch adds a bounds check in `scalarizeExtExtract` and bails out
when the extract index is out of range, avoiding the invalid shift
construction.

The regression test uses the reduced reproducer from #218724.
DeltaFile
+18-0llvm/test/Transforms/VectorCombine/ext-extract-oob.ll
+4-0llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+22-02 files