[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Zhou Sheng
zhousheng00 at gmail.com
Wed Mar 28 21:46:12 PDT 2007
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.707 -> 1.708
---
Log message:
Clean up some codes in InstCombiner::SimplifyDemandedBits().
---
Diffs of the changes: (+6 -12)
InstructionCombining.cpp | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.707 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.708
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.707 Wed Mar 28 21:26:30 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Mar 28 23:45:55 2007
@@ -1135,10 +1135,9 @@
uint32_t SrcBitWidth = SrcTy->getBitWidth();
DemandedMask &= SrcTy->getMask().zext(BitWidth);
- uint32_t zextBf = SrcTy->getBitWidth();
- DemandedMask.trunc(zextBf);
- RHSKnownZero.trunc(zextBf);
- RHSKnownOne.trunc(zextBf);
+ DemandedMask.trunc(SrcBitWidth);
+ RHSKnownZero.trunc(SrcBitWidth);
+ RHSKnownOne.trunc(SrcBitWidth);
if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
RHSKnownZero, RHSKnownOne, Depth+1))
return true;
@@ -1168,10 +1167,9 @@
if ((NewBits & DemandedMask) != 0)
InputDemandedBits |= InSignBit;
- uint32_t sextBf = SrcTy->getBitWidth();
- InputDemandedBits.trunc(sextBf);
- RHSKnownZero.trunc(sextBf);
- RHSKnownOne.trunc(sextBf);
+ InputDemandedBits.trunc(SrcBitWidth);
+ RHSKnownZero.trunc(SrcBitWidth);
+ RHSKnownOne.trunc(SrcBitWidth);
if (SimplifyDemandedBits(I->getOperand(0), InputDemandedBits,
RHSKnownZero, RHSKnownOne, Depth+1))
return true;
@@ -1193,10 +1191,6 @@
return UpdateValueUsesWith(I, NewCast);
} else if (RHSKnownOne[SrcBitWidth-1]) { // Input sign bit known set
RHSKnownOne |= NewBits;
- RHSKnownZero &= ~NewBits;
- } else { // Input sign bit unknown
- RHSKnownZero &= ~NewBits;
- RHSKnownOne &= ~NewBits;
}
break;
}
More information about the llvm-commits
mailing list