diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-04-16 22:21:14 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-04-16 22:21:14 +0000 |
commit | 9a9203b8948cc4ab275ca21d34821589e272c47c (patch) | |
tree | 87dd1062a10d35de60b260034c191f1062f49963 /lib/CodeGen | |
parent | ed48de2375d99af005a84d15e750a8092ce73390 (diff) | |
download | external_llvm-9a9203b8948cc4ab275ca21d34821589e272c47c.zip external_llvm-9a9203b8948cc4ab275ca21d34821589e272c47c.tar.gz external_llvm-9a9203b8948cc4ab275ca21d34821589e272c47c.tar.bz2 |
Fix problems in the PartSet lowering having to do with incorrect bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 501c12c..72c0f3b 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -538,8 +538,10 @@ static Instruction *LowerPartSet(CallInst *CI) { 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 @@ static Instruction *LowerPartSet(CallInst *CI) { 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); |