[llvm-commits] [llvm] r40741 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner sabre at nondot.org
Thu Aug 2 10:23:38 PDT 2007


Author: lattner
Date: Thu Aug  2 12:23:38 2007
New Revision: 40741

URL: http://llvm.org/viewvc/llvm-project?rev=40741&view=rev
Log:
Replacing a cast with another one does not reduce the number of 
casts in the input.

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

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=40741&r1=40740&r2=40741&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Thu Aug  2 12:23:38 2007
@@ -6384,12 +6384,10 @@
   case Instruction::SExt:
   case Instruction::Trunc:
     // If this is the same kind of case as our original (e.g. zext+zext), we
-    // can safely eliminate it.
-    break;  // FIXME: This causes PR1594
-    if (I->getOpcode() == CastOpc) {
-      ++NumCastsRemoved;
+    // can safely replace it.  Note that replacing it does not reduce the number
+    // of casts in the input.
+    if (I->getOpcode() == CastOpc)
       return true;
-    }
     break;
   default:
     // TODO: Can handle more cases here.





More information about the llvm-commits mailing list