[llvm-commits] [llvm] r127427 - /llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp

Dan Gohman gohman at apple.com
Thu Mar 10 12:57:44 PST 2011


Author: djg
Date: Thu Mar 10 14:57:44 2011
New Revision: 127427

URL: http://llvm.org/viewvc/llvm-project?rev=127427&view=rev
Log:
RecursivelyDeleteTriviallyDeadInstructions only needs a
Value, not an Instruction, so casting is not necessary. Also,
it's theoretically possible that the Value is not an
Instruction, since WeakVH follows RAUWs.

Modified:
    llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=127427&r1=127426&r2=127427&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Thu Mar 10 14:57:44 2011
@@ -1097,9 +1097,8 @@
 
   // Now that we're done, delete any instructions which are no longer used.
   while (!DeadInsts.empty())
-    if (Instruction *Inst =
-          cast_or_null<Instruction>((Value *)DeadInsts.pop_back_val()))
-      RecursivelyDeleteTriviallyDeadInstructions(Inst);
+    if (Value *V = DeadInsts.pop_back_val())
+      RecursivelyDeleteTriviallyDeadInstructions(V);
 
   // We are done with the rank map.
   RankMap.clear();





More information about the llvm-commits mailing list