[PATCH] D30836: Use setBits in SelectionDAG
Amaury SECHET via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 14:22:00 PST 2017
deadalnix updated this revision to Diff 91413.
deadalnix added a comment.
Revert KnownZeroLow
https://reviews.llvm.org/D30836
Files:
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2308,23 +2308,23 @@
if (TLI->getBooleanContents(Op.getValueType().isVector(), false) ==
TargetLowering::ZeroOrOneBooleanContent &&
BitWidth > 1)
- KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
+ KnownZero.setBitsFrom(1);
break;
case ISD::SETCC:
// If we know the result of a setcc has the top bits zero, use this info.
if (TLI->getBooleanContents(Op.getOperand(0).getValueType()) ==
TargetLowering::ZeroOrOneBooleanContent &&
BitWidth > 1)
- KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - 1);
+ KnownZero.setBitsFrom(1);
break;
case ISD::SHL:
if (const APInt *ShAmt = getValidShiftAmountConstant(Op)) {
computeKnownBits(Op.getOperand(0), KnownZero, KnownOne, DemandedElts,
Depth + 1);
KnownZero = KnownZero << *ShAmt;
KnownOne = KnownOne << *ShAmt;
// Low bits are known zero.
- KnownZero |= APInt::getLowBitsSet(BitWidth, ShAmt->getZExtValue());
+ KnownZero.setLowBits(ShAmt->getZExtValue());
}
break;
case ISD::SRL:
@@ -2334,8 +2334,7 @@
KnownZero = KnownZero.lshr(*ShAmt);
KnownOne = KnownOne.lshr(*ShAmt);
// High bits are known zero.
- APInt HighBits = APInt::getHighBitsSet(BitWidth, ShAmt->getZExtValue());
- KnownZero |= HighBits;
+ KnownZero.setHighBits(ShAmt->getZExtValue());
}
break;
case ISD::SRA:
@@ -2498,7 +2497,7 @@
if (TLI->getBooleanContents(Op.getOperand(0).getValueType()) ==
TargetLowering::ZeroOrOneBooleanContent &&
BitWidth > 1)
- KnownZero.setBits(1, BitWidth);
+ KnownZero.setBitsFrom(1);
break;
}
LLVM_FALLTHROUGH;
@@ -2549,7 +2548,7 @@
if (TLI->getBooleanContents(Op.getOperand(0).getValueType()) ==
TargetLowering::ZeroOrOneBooleanContent &&
BitWidth > 1)
- KnownZero.setBits(1, BitWidth);
+ KnownZero.setBitsFrom(1);
break;
}
LLVM_FALLTHROUGH;
@@ -2749,7 +2748,7 @@
KnownZero &= KnownZero2;
KnownOne &= KnownOne2;
- KnownZero |= APInt::getHighBitsSet(BitWidth, LeadZero);
+ KnownZero.setHighBits(LeadZero);
break;
}
case ISD::UMAX: {
@@ -2765,7 +2764,7 @@
KnownZero &= KnownZero2;
KnownOne &= KnownOne2;
- KnownOne |= APInt::getHighBitsSet(BitWidth, LeadOne);
+ KnownOne.setHighBits(LeadOne);
break;
}
case ISD::SMIN:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30836.91413.patch
Type: text/x-patch
Size: 2696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170310/a868fe72/attachment.bin>
More information about the llvm-commits
mailing list