summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-11-02 15:41:15 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-11-02 15:41:15 +0000
commit93f2f7fb6c323083ec39abc0b67a9b51dc416684 (patch)
tree55cf6c8bc8d6081d53ac513ab4da573ba37525f1 /llvm/lib/CodeGen/SelectionDAG
parent3501fdcb30510fd5b280cf3910aaa56cc259d556 (diff)
downloadbcm5719-llvm-93f2f7fb6c323083ec39abc0b67a9b51dc416684.tar.gz
bcm5719-llvm-93f2f7fb6c323083ec39abc0b67a9b51dc416684.zip
Use !operator to test if APInt is zero/non-zero. NFCI.
Avoids APInt construction and slower comparisons. llvm-svn: 285822
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 67a881f6204..98cd8190815 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2036,7 +2036,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
APInt KnownZero2, KnownOne2;
unsigned NumElts = DemandedElts.getBitWidth();
- if (DemandedElts == APInt(NumElts, 0))
+ if (!DemandedElts)
return; // No demanded elts, better to assume we don't know anything.
switch (Op.getOpcode()) {
@@ -2099,13 +2099,13 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
DemandedRHS.setBit((unsigned)M % NumElts);
}
// Known bits are the values that are shared by every demanded element.
- if (DemandedLHS != APInt(NumElts, 0)) {
+ if (!!DemandedLHS) {
SDValue LHS = Op.getOperand(0);
computeKnownBits(LHS, KnownZero2, KnownOne2, DemandedLHS, Depth + 1);
KnownOne &= KnownOne2;
KnownZero &= KnownZero2;
}
- if (DemandedRHS != APInt(NumElts, 0)) {
+ if (!!DemandedRHS) {
SDValue RHS = Op.getOperand(1);
computeKnownBits(RHS, KnownZero2, KnownOne2, DemandedRHS, Depth + 1);
KnownOne &= KnownOne2;
OpenPOWER on IntegriCloud