Skip to content

Commit ed03d11

Browse files
committed
use isa to get ExtractElts from current Instruction
1 parent a89787f commit ed03d11

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
@@ -2703,8 +2703,9 @@ bool VectorCombine::foldInsExtVectorToShuffle(Instruction &I) {
27032703
Mask[InsIdx] = ExtIdx + NumElts;
27042704
// Cost
27052705
ExtractElementInst *Ext;
2706-
if ((Ext = dyn_cast<ExtractElementInst>(I.getOperand(0))) == nullptr)
2707-
Ext = dyn_cast<ExtractElementInst>(I.getOperand(1));
2706+
Ext = isa<ExtractElementInst>(I.getOperand(0))
2707+
? cast<ExtractElementInst>(I.getOperand(0))
2708+
: cast<ExtractElementInst>(I.getOperand(1));
27082709

27092710
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
27102711
InstructionCost OldCost =

0 commit comments

Comments
 (0)