aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-03 00:52:03 +0000
committerDan Gohman <gohman@apple.com>2008-07-03 00:52:03 +0000
commit9b44c1f2a0ebe31e670994cfe131c7c3e0e80494 (patch)
treec237c61a76d03e73055ead322f6d970d62c635ad /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentce3c413e077211c505465cb53d005342a5b1f96c (diff)
Avoid unnecessarily copying APInt objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index e459ae74ec..9cce7380fc 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/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);