[llvm] r288814 - Avoid repeated calls to Op.getOpcode(). NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 06:50:09 PST 2016
Author: rksimon
Date: Tue Dec 6 08:50:09 2016
New Revision: 288814
URL: http://llvm.org/viewvc/llvm-project?rev=288814&view=rev
Log:
Avoid repeated calls to Op.getOpcode(). NFCI.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=288814&r1=288813&r2=288814&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Dec 6 08:50:09 2016
@@ -2039,7 +2039,8 @@ void SelectionDAG::computeKnownBits(SDVa
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(SDVa
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(SDVa
break;
default:
- if (Op.getOpcode() < ISD::BUILTIN_OP_END)
+ if (Opcode < ISD::BUILTIN_OP_END)
break;
LLVM_FALLTHROUGH;
case ISD::INTRINSIC_WO_CHAIN:
More information about the llvm-commits
mailing list