From ecbd0413af5abdb08046b50f526da4722aafff2b Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 4 Nov 2020 17:15:54 +0000 Subject: [PATCH] [KnownBits] KnownBits::computeForMul - avoid unnecessary APInt copies. NFCI. Use const references instead. --- llvm/lib/Support/KnownBits.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Support/KnownBits.cpp b/llvm/lib/Support/KnownBits.cpp index 0c88ca6..cce7120 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. -- 2.7.4