llvm.org GIT mirror llvm / 483eed9
[APInt] Remove an APInt copy from the return of APInt::multiplicativeInverse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302816 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
1 changed file(s) with 4 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
11401140 // interested in a positive inverse. Calculate a positive one from a negative
11411141 // one if necessary. A simple addition of the modulo suffices because
11421142 // abs(t[i]) is known to be less than *this/2 (see the link above).
1143 return t[i].isNegative() ? t[i] + modulo : t[i];
1143 if (t[i].isNegative())
1144 t[i] += modulo;
1145
1146 return std::move(t[i]);
11441147 }
11451148
11461149 /// Calculate the magic numbers required to implement a signed integer division