[llvm] ce58752 - [APFloat] multiplySignificand - pass IEEEFloat as const reference. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 1 07:44:07 PST 2021
Author: Simon Pilgrim
Date: 2021-02-01T15:41:50Z
New Revision: ce587529ad8b5347fa8896e6811469c1857ed1a2
URL: https://github.com/llvm/llvm-project/commit/ce587529ad8b5347fa8896e6811469c1857ed1a2
DIFF: https://github.com/llvm/llvm-project/commit/ce587529ad8b5347fa8896e6811469c1857ed1a2.diff
LOG: [APFloat] multiplySignificand - pass IEEEFloat as const reference. NFCI.
Avoids unnecessary IEEEFloat copies.
Added:
Modified:
llvm/include/llvm/ADT/APFloat.h
llvm/lib/Support/APFloat.cpp
Removed:
################################################################################
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 @@ class IEEEFloat final : public APFloatBase {
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;
More information about the llvm-commits
mailing list