summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-12-06 14:50:09 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-12-06 14:50:09 +0000
commit29c17f3f588b58225574a8cb295cb8494fc9fc27 (patch)
treee20a64f1e2e3155782b8307f23a186a3443493be /llvm/lib/CodeGen
parentf92d44c673f62676476a4cc035a28a894ac07180 (diff)
downloadbcm5719-llvm-29c17f3f588b58225574a8cb295cb8494fc9fc27.tar.gz
bcm5719-llvm-29c17f3f588b58225574a8cb295cb8494fc9fc27.zip
Avoid repeated calls to Op.getOpcode(). NFCI.
llvm-svn: 288814
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index fc0cdeebb63..297a7c3121a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2039,7 +2039,8 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
if (!DemandedElts)
return; // No demanded elts, better to assume we don't know anything.
- switch (Op.getOpcode()) {
+ unsigned Opcode = Op.getOpcode();
+ switch (Opcode) {
case ISD::Constant:
// We know all of the bits for a constant!
KnownOne = cast<ConstantSDNode>(Op)->getAPIntValue();
@@ -2478,7 +2479,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
KnownZeroLow = std::min(KnownZeroLow,
KnownZero2.countTrailingOnes());
- if (Op.getOpcode() == ISD::ADD) {
+ if (Opcode == ISD::ADD) {
KnownZero |= APInt::getLowBitsSet(BitWidth, KnownZeroLow);
if (KnownZeroHigh > 1)
KnownZero |= APInt::getHighBitsSet(BitWidth, KnownZeroHigh - 1);
@@ -2622,7 +2623,7 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero,
break;
default:
- if (Op.getOpcode() < ISD::BUILTIN_OP_END)
+ if (Opcode < ISD::BUILTIN_OP_END)
break;
LLVM_FALLTHROUGH;
case ISD::INTRINSIC_WO_CHAIN:
OpenPOWER on IntegriCloud