Skip to content

Commit

Permalink
[SLP] Avoid unnecessary getIncomingValueForBlock() call (NFC)
Browse files Browse the repository at this point in the history
This code just wants to check all incoming values, we don't care
care what the incoming block is here.
  • Loading branch information
nikic committed Mar 17, 2022
1 parent 14452c4 commit 1dbeb64
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Expand Up @@ -4062,10 +4062,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,

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

0 comments on commit 1dbeb64

Please sign in to comment.