Skip to content

Commit dad00aa

Browse files
committed
use isa to get ExtractElts from current Instruction
1 parent cca6bdb commit dad00aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,8 +2805,9 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
28052805
Mask[InsIdx] = ExtIdx + NumElts;
28062806
// Cost
28072807
ExtractElementInst *Ext;
2808-
if ((Ext = dyn_cast<ExtractElementInst>(I.getOperand(0))) == nullptr)
2809-
Ext = dyn_cast<ExtractElementInst>(I.getOperand(1));
2808+
Ext = isa<ExtractElementInst>(I.getOperand(0))
2809+
? cast<ExtractElementInst>(I.getOperand(0))
2810+
: cast<ExtractElementInst>(I.getOperand(1));
28102811

28112812
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
28122813
InstructionCost OldCost =

0 commit comments

Comments
 (0)