[llvm] [SLP] Fix crash on extractelement with out-of-bounds index.....Fixes … (PR #176918)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 20 09:29:54 PST 2026
================
@@ -15042,7 +15042,14 @@ BoUpSLP::getEntryCost(const TreeEntry *E, ArrayRef<Value *> VectorizedVals,
}
if (DemandedElts.isZero())
DemandedElts = APInt::getZero(getNumElements(SrcVecTy));
- DemandedElts.setBit(*getExtractIndex(I));
+ unsigned ExtIdx = *getExtractIndex(I);
+ //Out-of-bounds extractelement produces poison.So it do no corresponds to a concrete vector lane,
+ // so instead of treating it as an invalid pattern we can avoid marking any demanded element
+ if (ExtIdx < DemandedElts.getBitWidth())
+ {
+ DemandedElts.setBit(ExtIdx);
+ }
+ // DemandedElts.setBit(*getExtractIndex(I));
----------------
Soumik15630 wrote:
it should be availble now 1 minute , pushed in the wrong branch - sorry for inconvenience
https://github.com/llvm/llvm-project/pull/176918
More information about the llvm-commits
mailing list