[llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp

Reid Spencer reid at x10sys.com
Mon Apr 16 15:21:40 PDT 2007



Changes in directory llvm/lib/CodeGen:

IntrinsicLowering.cpp updated: 1.80 -> 1.81
---
Log message:

Fix problems in the PartSet lowering having to do with incorrect bit width.


---
Diffs of the changes:  (+5 -3)

 IntrinsicLowering.cpp |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.80 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.81
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.80	Thu Apr 12 16:53:38 2007
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp	Mon Apr 16 17:21:14 2007
@@ -538,8 +538,10 @@
     new BranchInst(large, small, is_large, entry);
 
     // Block "large"
-    BinaryOperator* MaskBits = 
+    Instruction* MaskBits = 
       BinaryOperator::createSub(RepBitWidth, NumBits, "", large);
+    MaskBits = CastInst::createIntegerCast(MaskBits, RepMask->getType(), 
+                                           false, "", large);
     BinaryOperator* Mask1 = 
       BinaryOperator::createLShr(RepMask, MaskBits, "", large);
     BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large);
@@ -575,10 +577,10 @@
     Value* t8    = BinaryOperator::createXor(t7, ValMask, "", reverse);
     Value* t9    = BinaryOperator::createAnd(t8, Val, "", reverse);
     Value* t10   = BinaryOperator::createShl(Rep4, Lo, "", reverse);
-    if (RepBits < ValBits)
+    if (32 < ValBits)
       RepBitWidth = 
         cast<ConstantInt>(ConstantExpr::getZExt(RepBitWidth, ValTy));
-    else if (RepBits > ValBits)
+    else if (32 > ValBits)
       RepBitWidth = 
         cast<ConstantInt>(ConstantExpr::getTrunc(RepBitWidth, ValTy));
     Value* t11   = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse);






More information about the llvm-commits mailing list