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

Chris Lattner sabre at nondot.org
Tue Nov 10 09:00:48 PST 2009


Author: lattner
Date: Tue Nov 10 11:00:47 2009
New Revision: 86689

URL: http://llvm.org/viewvc/llvm-project?rev=86689&view=rev
Log:
clarify logic.

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=86689&r1=86688&r2=86689&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Nov 10 11:00:47 2009
@@ -8261,10 +8261,10 @@
   // Only do this if the dest type is a simple type, don't convert the
   // expression tree to something weird like i93 unless the source is also
   // strange.
-  if (!isa<IntegerType>(SrcI->getType()) ||
-      (ShouldChangeType(SrcI->getType(), DestTy, TD) &&
-       CanEvaluateInDifferentType(SrcI, DestTy,
-                                  CI.getOpcode(), NumCastsRemoved))) {
+  if ((isa<VectorType>(DestTy) ||
+       ShouldChangeType(SrcI->getType(), DestTy, TD)) &&
+      CanEvaluateInDifferentType(SrcI, DestTy,
+                                 CI.getOpcode(), NumCastsRemoved)) {
     // If this cast is a truncate, evaluting in a different type always
     // eliminates the cast, so it is always a win.  If this is a zero-extension,
     // we need to do an AND to maintain the clear top-part of the computation,





More information about the llvm-commits mailing list