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 @@ -3713,23 +3713,19 @@ bool VectorCombine::shrinkLoadForShuffles(Instruction &I) {
3713
3713
auto GetIndexRangeInShuffles = [&]() -> std::optional<IndexRange> {
3714
3714
IndexRange OutputRange = IndexRange (VecTy->getNumElements (), -1 );
3715
3715
for (auto &Use : I.uses ()) {
3716
- // All uses must be shufflevector instructions.
3717
- auto *Shuffle = dyn_cast<ShuffleVectorInst>(Use.getUser ());
3718
- if (!Shuffle)
3716
+ // Ensure all uses match the required pattern.
3717
+ User *Shuffle = Use.getUser ();
3718
+ Value *Op0 = nullptr ;
3719
+ ArrayRef<int > Mask;
3720
+
3721
+ if (!match (Shuffle, m_Shuffle (m_Value (Op0), m_Undef (), m_Mask (Mask))))
3719
3722
return std::nullopt;
3720
3723
3721
3724
// Ignore shufflevector instructions that have no uses.
3722
3725
if (!Shuffle->hasNUsesOrMore (1u ))
3723
3726
continue ;
3724
3727
3725
- // Ensure second operand is a poison value.
3726
- auto *Op0 = Shuffle->getOperand (0 );
3727
- auto *Op1 = Shuffle->getOperand (1 );
3728
- if (!isa<PoisonValue>(Op1) && !isa<UndefValue>(Op1))
3729
- return std::nullopt;
3730
-
3731
3728
// Find the min and max indices used by the shufflevector instruction.
3732
- ArrayRef<int > Mask = Shuffle->getShuffleMask ();
3733
3729
auto *Op0Ty = cast<FixedVectorType>(Op0->getType ());
3734
3730
auto NumElems = int (Op0Ty->getNumElements ());
3735
3731
You can’t perform that action at this time.
0 commit comments