summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-09-17 18:19:02 +0000
committerCraig Topper <craig.topper@intel.com>2019-09-17 18:19:02 +0000
commitb5ffbd0b14529f382f9788abf0dd43b20bcdd6b5 (patch)
treea268c41165139e38000c6bb61d3108bdb7e196db /llvm/lib/CodeGen
parenta5aa3353946d7c51cf086629763a5cb507d4a26f (diff)
downloadbcm5719-llvm-b5ffbd0b14529f382f9788abf0dd43b20bcdd6b5.tar.gz
bcm5719-llvm-b5ffbd0b14529f382f9788abf0dd43b20bcdd6b5.zip
[SimplifyDemandedBits] Use APInt::intersects to instead of ANDing and comparing to 0 separately. NFC
llvm-svn: 372158
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 41b3ba1733d..cd7f64efa75 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1285,7 +1285,7 @@ bool TargetLowering::SimplifyDemandedBits(
// out) are never demanded.
// TODO - support non-uniform vector amounts.
if (Op0.getOpcode() == ISD::SRL) {
- if ((DemandedBits & APInt::getLowBitsSet(BitWidth, ShAmt)) == 0) {
+ if (!DemandedBits.intersects(APInt::getLowBitsSet(BitWidth, ShAmt))) {
if (ConstantSDNode *SA2 =
isConstOrConstSplat(Op0.getOperand(1), DemandedElts)) {
if (SA2->getAPIntValue().ult(BitWidth)) {
@@ -1392,7 +1392,8 @@ bool TargetLowering::SimplifyDemandedBits(
if (Op0.getOpcode() == ISD::SHL) {
if (ConstantSDNode *SA2 =
isConstOrConstSplat(Op0.getOperand(1), DemandedElts)) {
- if ((DemandedBits & APInt::getHighBitsSet(BitWidth, ShAmt)) == 0) {
+ if (!DemandedBits.intersects(
+ APInt::getHighBitsSet(BitWidth, ShAmt))) {
if (SA2->getAPIntValue().ult(BitWidth)) {
unsigned C1 = SA2->getZExtValue();
unsigned Opc = ISD::SRL;
OpenPOWER on IntegriCloud