File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -3505,23 +3505,19 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
3505
3505
auto GetIndexRangeInShuffles = [&]() -> std::optional<IndexRange> {
3506
3506
IndexRange OutputRange = IndexRange (VecTy->getNumElements (), -1 );
3507
3507
for (auto &Use : I.uses ()) {
3508
- // All uses must be shufflevector instructions.
3509
- auto *Shuffle = dyn_cast<ShuffleVectorInst>(Use.getUser ());
3510
- if (!Shuffle)
3508
+ // Ensure all uses match the required pattern.
3509
+ User *Shuffle = Use.getUser ();
3510
+ Value *Op0 = nullptr ;
3511
+ ArrayRef<int > Mask;
3512
+
3513
+ if (!match (Shuffle, m_Shuffle (m_Value (Op0), m_Undef (), m_Mask (Mask))))
3511
3514
return std::nullopt;
3512
3515
3513
3516
// Ignore shufflevector instructions that have no uses.
3514
3517
if (!Shuffle->hasNUsesOrMore (1u ))
3515
3518
continue ;
3516
3519
3517
- // Ensure second operand is a poison value.
3518
- auto *Op0 = Shuffle->getOperand (0 );
3519
- auto *Op1 = Shuffle->getOperand (1 );
3520
- if (!isa<PoisonValue>(Op1) && !isa<UndefValue>(Op1))
3521
- return std::nullopt;
3522
-
3523
3520
// Find the min and max indices used by the shufflevector instruction.
3524
- ArrayRef<int > Mask = Shuffle->getShuffleMask ();
3525
3521
auto *Op0Ty = cast<FixedVectorType>(Op0->getType ());
3526
3522
auto NumElems = int (Op0Ty->getNumElements ());
3527
3523
You can’t perform that action at this time.
0 commit comments