summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-13 12:44:03 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-13 12:44:03 +0000
commitd845bc3d0c7f309e932a4d59d703d007787ac49b (patch)
treea27094cd6d7dc9457040a6f74ebc84829522f2af /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parente47362c1ec1ea31b626336cc05822035601c3e57 (diff)
downloadbcm5719-llvm-d845bc3d0c7f309e932a4d59d703d007787ac49b.tar.gz
bcm5719-llvm-d845bc3d0c7f309e932a4d59d703d007787ac49b.zip
TargetLowering::SimplifyDemandedBits - early-out for UNDEF ops. NFCI.
llvm-svn: 360579
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index fc7e7d9c3ce..89298133a0d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -588,6 +588,10 @@ bool TargetLowering::SimplifyDemandedBits(
// Don't know anything.
Known = KnownBits(BitWidth);
+ // Undef operand.
+ if (Op.isUndef())
+ return false;
+
if (Op.getOpcode() == ISD::Constant) {
// We know all of the bits for a constant!
Known.One = cast<ConstantSDNode>(Op)->getAPIntValue();
@@ -610,9 +614,7 @@ bool TargetLowering::SimplifyDemandedBits(
DemandedElts = APInt::getAllOnesValue(NumElts);
} else if (OriginalDemandedBits == 0 || OriginalDemandedElts == 0) {
// Not demanding any bits/elts from Op.
- if (!Op.isUndef())
- return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT));
- return false;
+ return TLO.CombineTo(Op, TLO.DAG.getUNDEF(VT));
} else if (Depth == 6) { // Limit search depth.
return false;
}
OpenPOWER on IntegriCloud