Skip to content

Commit 54c058d

Browse files
committed
Address comments
1 parent 044f73f commit 54c058d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7583,11 +7583,22 @@ static bool passingValueIsAlwaysUndefined(Value *V, Instruction *I, bool PtrValu
75837583
if (Use->getParent() != I->getParent() || Use == I || Use->comesBefore(I))
75847584
return false;
75857585
// Change this list when we want to add new instructions.
7586-
if (!isa<GetElementPtrInst>(Use) && !isa<ReturnInst>(Use) &&
7587-
!isa<BitCastInst>(Use) && !isa<LoadInst>(Use) &&
7588-
!isa<StoreInst>(Use) && !isa<AssumeInst>(Use) && !isa<CallBase>(Use))
7586+
switch (Use->getOpcode()) {
7587+
default:
75897588
return false;
7590-
return true;
7589+
case Instruction::GetElementPtr:
7590+
return true;
7591+
case Instruction::Ret:
7592+
return true;
7593+
case Instruction::BitCast:
7594+
return true;
7595+
case Instruction::Load:
7596+
return true;
7597+
case Instruction::Store:
7598+
return true;
7599+
case Instruction::Call:
7600+
return true;
7601+
}
75917602
});
75927603
if (FindUse == I->user_end())
75937604
return false;

0 commit comments

Comments
 (0)