From e9765ac2757aec5c3346a7a498be06d9427d4c77 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Fri, 14 Sep 2018 04:50:38 +0000 Subject: [PATCH] [NFC] Remove meaningless code from GVN llvm-svn: 342202 --- llvm/lib/Transforms/Scalar/GVN.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp index 185b223..d6c2824 100644 --- a/llvm/lib/Transforms/Scalar/GVN.cpp +++ b/llvm/lib/Transforms/Scalar/GVN.cpp @@ -2073,18 +2073,12 @@ bool GVN::processBlock(BasicBlock *BB) { if (!AtStart) --BI; - const Instruction *MaybeFirstICF = ICF->getFirstICFI(BB); for (auto *I : InstrsToErase) { assert(I->getParent() == BB && "Removing instruction from wrong block?"); LLVM_DEBUG(dbgs() << "GVN removed: " << *I << '\n'); salvageDebugInfo(*I); if (MD) MD->removeInstruction(I); LLVM_DEBUG(verifyRemoved(I)); - if (MaybeFirstICF == I) { - // We have erased the first ICF in block. The map needs to be updated. - // Do not keep dangling pointer on the erased instruction. - MaybeFirstICF = nullptr; - } I->eraseFromParent(); } -- 2.7.4