[llvm] r353637 - [Local] Delete a redundant check. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 10 01:25:57 PST 2019


Author: maskray
Date: Sun Feb 10 01:25:56 2019
New Revision: 353637

URL: http://llvm.org/viewvc/llvm-project?rev=353637&view=rev
Log:
[Local] Delete a redundant check. NFC

isInstructionTriviallyDead also performs the use_empty() check.

Modified:
    llvm/trunk/lib/Transforms/Utils/Local.cpp

Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=353637&r1=353636&r2=353637&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Sun Feb 10 01:25:56 2019
@@ -429,7 +429,7 @@ bool llvm::wouldInstructionBeTriviallyDe
 bool llvm::RecursivelyDeleteTriviallyDeadInstructions(
     Value *V, const TargetLibraryInfo *TLI, MemorySSAUpdater *MSSAU) {
   Instruction *I = dyn_cast<Instruction>(V);
-  if (!I || !I->use_empty() || !isInstructionTriviallyDead(I, TLI))
+  if (!I || !isInstructionTriviallyDead(I, TLI))
     return false;
 
   SmallVector<Instruction*, 16> DeadInsts;




More information about the llvm-commits mailing list