Skip to content

Commit b85387d

Browse files
committed
[SCCP] Check instruction type before querying PredicateInfo (NFC)
Do the cheap intrinsic check before the hash lookup for the PredicateInfo.
1 parent f704782 commit b85387d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Utils/SCCPSolver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,9 +771,9 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
771771

772772
for (BasicBlock &BB : F) {
773773
for (Instruction &Inst : llvm::make_early_inc_range(BB)) {
774-
if (It->second->getPredicateInfoFor(&Inst)) {
775-
if (auto *II = dyn_cast<IntrinsicInst>(&Inst)) {
776-
if (II->getIntrinsicID() == Intrinsic::ssa_copy) {
774+
if (auto *II = dyn_cast<IntrinsicInst>(&Inst)) {
775+
if (II->getIntrinsicID() == Intrinsic::ssa_copy) {
776+
if (It->second->getPredicateInfoFor(&Inst)) {
777777
Value *Op = II->getOperand(0);
778778
Inst.replaceAllUsesWith(Op);
779779
Inst.eraseFromParent();

0 commit comments

Comments
 (0)