[llvm-branch-commits] [llvm-branch] r115406 - /llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp

Gabor Greif ggreif at gmail.com
Fri Oct 1 20:13:59 PDT 2010


Author: ggreif
Date: Fri Oct  1 22:13:59 2010
New Revision: 115406

URL: http://llvm.org/viewvc/llvm-project?rev=115406&view=rev
Log:
fix bitwidth discrepancies

Modified:
    llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=115406&r1=115405&r2=115406&view=diff
==============================================================================
--- llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/branches/ggreif/switch-opts/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Oct  1 22:13:59 2010
@@ -912,9 +912,10 @@
         BranchInst::Create(I->getSuccessor(Leg), New, Cmp, Old);
         I->removeCase(Leg);
 
-
-APInt KnownZero, KnownOne;
-ComputeMaskedBits(A, cast<IntegerType>(Ty)->getMask(), KnownZero, KnownOne);
+const Type *Ty2 = A->getType();
+APInt Mask(cast<IntegerType>(Ty2)->getMask());
+APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0);
+ComputeMaskedBits(A, Mask, KnownZero, KnownOne);
 
 
         return true;
@@ -922,8 +923,8 @@
     }
   }
   else {
-APInt KnownZero, KnownOne;
-ComputeMaskedBits(condition, cast<IntegerType>(Ty)->getMask(), KnownZero, KnownOne);
+//APInt KnownZero, KnownOne;
+//ComputeMaskedBits(condition, cast<IntegerType>(Ty)->getMask(), KnownZero, KnownOne);
 return false;
   }
 





More information about the llvm-branch-commits mailing list