[llvm] ecbd041 - [KnownBits] KnownBits::computeForMul - avoid unnecessary APInt copies. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 09:25:54 PST 2020


Author: Simon Pilgrim
Date: 2020-11-04T17:25:25Z
New Revision: ecbd0413af5abdb08046b50f526da4722aafff2b

URL: https://github.com/llvm/llvm-project/commit/ecbd0413af5abdb08046b50f526da4722aafff2b
DIFF: https://github.com/llvm/llvm-project/commit/ecbd0413af5abdb08046b50f526da4722aafff2b.diff

LOG: [KnownBits] KnownBits::computeForMul - avoid unnecessary APInt copies. NFCI.

Use const references instead.

Added: 
    

Modified: 
    llvm/lib/Support/KnownBits.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/KnownBits.cpp b/llvm/lib/Support/KnownBits.cpp
index 0c88ca68fba4..cce7120e8d46 100644
--- a/llvm/lib/Support/KnownBits.cpp
+++ b/llvm/lib/Support/KnownBits.cpp
@@ -280,8 +280,8 @@ KnownBits KnownBits::computeForMul(const KnownBits &LHS, const KnownBits &RHS) {
   // Where C5, C6 describe the known bits of %a, %b
   // C1, C2 describe the known bottom bits of %a, %b.
   // C7 describes the mask of the known bits of the result.
-  APInt Bottom0 = LHS.One;
-  APInt Bottom1 = RHS.One;
+  const APInt &Bottom0 = LHS.One;
+  const APInt &Bottom1 = RHS.One;
 
   // How many times we'd be able to divide each argument by 2 (shr by 1).
   // This gives us the number of trailing zeros on the multiplication result.


        


More information about the llvm-commits mailing list