Skip to content

Commit 1dbeb64

Browse files
committed
[SLP] Avoid unnecessary getIncomingValueForBlock() call (NFC)
This code just wants to check all incoming values, we don't care care what the incoming block is here.
1 parent 14452c4 commit 1dbeb64

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4062,10 +4062,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
40624062

40634063
// Check for terminator values (e.g. invoke).
40644064
for (Value *V : VL)
4065-
for (unsigned I = 0, E = PH->getNumIncomingValues(); I < E; ++I) {
4066-
Instruction *Term = dyn_cast<Instruction>(
4067-
cast<PHINode>(V)->getIncomingValueForBlock(
4068-
PH->getIncomingBlock(I)));
4065+
for (Value *Incoming : cast<PHINode>(V)->incoming_values()) {
4066+
Instruction *Term = dyn_cast<Instruction>(Incoming);
40694067
if (Term && Term->isTerminator()) {
40704068
LLVM_DEBUG(dbgs()
40714069
<< "SLP: Need to swizzle PHINodes (terminator use).\n");

0 commit comments

Comments
 (0)