diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-03 00:52:03 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-03 00:52:03 +0000 |
commit | f3c4d7f877063573ab19b661a982730302d479f8 (patch) | |
tree | d63c4ade2a4168d91f11d75974a0f28007f0eb42 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 4c6db53a3675e062013a752e66f1c75ccbe3bcd1 (diff) | |
download | bcm5719-llvm-f3c4d7f877063573ab19b661a982730302d479f8.tar.gz bcm5719-llvm-f3c4d7f877063573ab19b661a982730302d479f8.zip |
Avoid unnecessarily copying APInt objects.
llvm-svn: 53065
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index e459ae74ec8..9cce7380fca 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1601,7 +1601,7 @@ void SelectionDAG::ComputeMaskedBits(SDOperand Op, const APInt &Mask, } case ISD::SREM: if (ConstantSDNode *Rem = dyn_cast<ConstantSDNode>(Op.getOperand(1))) { - APInt RA = Rem->getAPIntValue(); + const APInt &RA = Rem->getAPIntValue(); if (RA.isPowerOf2() || (-RA).isPowerOf2()) { APInt LowBits = RA.isStrictlyPositive() ? (RA - 1) : ~RA; APInt Mask2 = LowBits | APInt::getSignBit(BitWidth); @@ -1623,7 +1623,7 @@ void SelectionDAG::ComputeMaskedBits(SDOperand Op, const APInt &Mask, return; case ISD::UREM: { if (ConstantSDNode *Rem = dyn_cast<ConstantSDNode>(Op.getOperand(1))) { - APInt RA = Rem->getAPIntValue(); + const APInt &RA = Rem->getAPIntValue(); if (RA.isPowerOf2()) { APInt LowBits = (RA - 1); APInt Mask2 = LowBits & Mask; @@ -2305,7 +2305,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT VT, if (N1C) { if (N2C) { - APInt C1 = N1C->getAPIntValue(), C2 = N2C->getAPIntValue(); + const APInt &C1 = N1C->getAPIntValue(), &C2 = N2C->getAPIntValue(); switch (Opcode) { case ISD::ADD: return getConstant(C1 + C2, VT); case ISD::SUB: return getConstant(C1 - C2, VT); |