summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-03-10 20:42:19 +0000
committerDan Gohman <gohman@apple.com>2008-03-10 20:42:19 +0000
commit272e234477d351b30ca55f4369cdb61c31b34e9d (patch)
treed89ab884e3b9284626bee7e2a7d9b2935ea5f5fa /llvm/lib/CodeGen
parentb9e4280e94a30b67ae1c4b93ee972f75ad814c7b (diff)
downloadbcm5719-llvm-272e234477d351b30ca55f4369cdb61c31b34e9d.tar.gz
bcm5719-llvm-272e234477d351b30ca55f4369cdb61c31b34e9d.zip
Fix mul expansion to check the correct number of bits for
zero extension when checking if an unsigned multiply is safe. llvm-svn: 48171
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index abd569b208e..1ef19ff50fa 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -6436,10 +6436,9 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
unsigned InnerBitSize = RH.getValueSizeInBits();
unsigned LHSSB = DAG.ComputeNumSignBits(Op.getOperand(0));
unsigned RHSSB = DAG.ComputeNumSignBits(Op.getOperand(1));
- if (DAG.MaskedValueIsZero(Op.getOperand(0),
- APInt::getHighBitsSet(OuterBitSize, LHSSB)) &&
- DAG.MaskedValueIsZero(Op.getOperand(1),
- APInt::getHighBitsSet(OuterBitSize, RHSSB))) {
+ APInt HighMask = APInt::getHighBitsSet(OuterBitSize, InnerBitSize);
+ if (DAG.MaskedValueIsZero(Node->getOperand(0), HighMask) &&
+ DAG.MaskedValueIsZero(Node->getOperand(1), HighMask)) {
// The inputs are both zero-extended.
if (HasUMUL_LOHI) {
// We can emit a umul_lohi.
OpenPOWER on IntegriCloud