Skip to content

Commit 191345e

Browse files
committed
Change the way to get ExtElts
1 parent 04af5c4 commit 191345e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,10 +2804,8 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
28042804
std::iota(Mask.begin(), Mask.end(), 0);
28052805
Mask[InsIdx] = ExtIdx + NumElts;
28062806
// Cost
2807-
ExtractElementInst *Ext;
2808-
Ext = isa<ExtractElementInst>(I.getOperand(0))
2809-
? cast<ExtractElementInst>(I.getOperand(0))
2810-
: cast<ExtractElementInst>(I.getOperand(1));
2807+
auto *Ins = cast<InsertElementInst>(&I);
2808+
auto *Ext = cast<ExtractElementInst>(I.getOperand(1));
28112809

28122810
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
28132811
InstructionCost OldCost =

0 commit comments

Comments
 (0)