aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2024-04-18 13:21:52 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2024-04-18 13:21:52 +0100
commit73b255c9f824157064212d341a255a962e746fd4 (patch)
tree4c676b0afe2c85a9037139095e84246958f2f55a /llvm/lib/CodeGen
parenta66c09a96dec633c1172a02818859f71fbff4f45 (diff)
downloadllvm-73b255c9f824157064212d341a255a962e746fd4.tar.gz
llvm-73b255c9f824157064212d341a255a962e746fd4.tar.bz2
llvm-73b255c9f824157064212d341a255a962e746fd4.zip
[DAG] Ensure extract_subvector(insert_subvector(x,y,c1),c2) --> extract_subvector(y,c2-c1) is working on fixed vector types
#87925 failed to ensure we weren't removing the extracted subvector from a scalable vector type Thanks to @antmox for the headsup.
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index c36b1cc9039c..6ac7d4ee95fb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -24478,7 +24478,8 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
unsigned NumSubElts = NVT.getVectorMinNumElements();
if (InsIdx <= ExtIdx && (ExtIdx + NumSubElts) <= (InsIdx + NumInsElts) &&
TLI.isExtractSubvectorCheap(NVT, InsSubVT, ExtIdx - InsIdx) &&
- InsSubVT.isFixedLengthVector() && NVT.isFixedLengthVector())
+ InsSubVT.isFixedLengthVector() && NVT.isFixedLengthVector() &&
+ V.getValueType().isFixedLengthVector())
return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, NVT, InsSub,
DAG.getVectorIdxConstant(ExtIdx - InsIdx, DL));
}