From ce587529ad8b5347fa8896e6811469c1857ed1a2 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 1 Feb 2021 15:41:03 +0000 Subject: [PATCH] [APFloat] multiplySignificand - pass IEEEFloat as const reference. NFCI. Avoids unnecessary IEEEFloat copies. --- llvm/include/llvm/ADT/APFloat.h | 4 ++-- llvm/lib/Support/APFloat.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h index 8aafd525196d..f3ec92ec4e33 100644 --- a/llvm/include/llvm/ADT/APFloat.h +++ b/llvm/include/llvm/ADT/APFloat.h @@ -492,8 +492,8 @@ private: integerPart addSignificand(const IEEEFloat &); integerPart subtractSignificand(const IEEEFloat &, integerPart); lostFraction addOrSubtractSignificand(const IEEEFloat &, bool subtract); - lostFraction multiplySignificand(const IEEEFloat &, IEEEFloat); - lostFraction multiplySignificand(const IEEEFloat&); + lostFraction multiplySignificand(const IEEEFloat &, const IEEEFloat &); + lostFraction multiplySignificand(const IEEEFloat &); lostFraction divideSignificand(const IEEEFloat &); void incrementSignificand(); void initialize(const fltSemantics *); diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 1069d1fb4603..946cd68493d6 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -1007,7 +1007,7 @@ IEEEFloat::integerPart IEEEFloat::subtractSignificand(const IEEEFloat &rhs, on to the full-precision result of the multiplication. Returns the lost fraction. */ lostFraction IEEEFloat::multiplySignificand(const IEEEFloat &rhs, - IEEEFloat addend) { + const IEEEFloat &addend) { unsigned int omsb; // One, not zero, based MSB. unsigned int partsCount, newPartsCount, precision; integerPart *lhsSignificand;