[llvm] r301694 - [ConstantRange] Use const references to prevent a couple APInt copies. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 14:48:03 PDT 2017


Author: ctopper
Date: Fri Apr 28 16:48:03 2017
New Revision: 301694

URL: http://llvm.org/viewvc/llvm-project?rev=301694&view=rev
Log:
[ConstantRange] Use const references to prevent a couple APInt copies. NFC

Modified:
    llvm/trunk/lib/IR/ConstantRange.cpp

Modified: llvm/trunk/lib/IR/ConstantRange.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantRange.cpp?rev=301694&r1=301693&r2=301694&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantRange.cpp (original)
+++ llvm/trunk/lib/IR/ConstantRange.cpp Fri Apr 28 16:48:03 2017
@@ -210,8 +210,8 @@ ConstantRange::makeGuaranteedNoWrapRegio
                                               -Other.getUnsignedMax()));
 
   if (NoWrapKind & OBO::NoSignedWrap) {
-    APInt SignedMin = Other.getSignedMin();
-    APInt SignedMax = Other.getSignedMax();
+    const APInt &SignedMin = Other.getSignedMin();
+    const APInt &SignedMax = Other.getSignedMax();
 
     if (SignedMax.isStrictlyPositive())
       Result = SubsetIntersect(




More information about the llvm-commits mailing list