diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-08 19:09:22 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-06-08 19:09:22 +0000 |
| commit | c321e534022768d424cf5c5ab43f99489e55bf07 (patch) | |
| tree | b8cb4306701534ee6e9ee7ea055dbc25b0c92494 /llvm/lib/Analysis/DependenceAnalysis.cpp | |
| parent | 19e88c1ff696313db48618d6ced7afcd5253fe35 (diff) | |
| download | bcm5719-llvm-c321e534022768d424cf5c5ab43f99489e55bf07.tar.gz bcm5719-llvm-c321e534022768d424cf5c5ab43f99489e55bf07.zip | |
Apply most suggestions of clang-tidy's performance-unnecessary-value-param
Avoids unnecessary copies. All changes audited & pass tests with asan.
No functional change intended.
llvm-svn: 272190
Diffstat (limited to 'llvm/lib/Analysis/DependenceAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/DependenceAnalysis.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index 3342bdffa39..796c872f014 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -1326,9 +1326,8 @@ bool DependenceInfo::weakCrossingSIVtest( // Computes the GCD of AM and BM. // Also finds a solution to the equation ax - by = gcd(a, b). // Returns true if dependence disproved; i.e., gcd does not divide Delta. -static -bool findGCD(unsigned Bits, APInt AM, APInt BM, APInt Delta, - APInt &G, APInt &X, APInt &Y) { +static bool findGCD(unsigned Bits, const APInt &AM, const APInt &BM, + const APInt &Delta, APInt &G, APInt &X, APInt &Y) { APInt A0(Bits, 1, true), A1(Bits, 0, true); APInt B0(Bits, 0, true), B1(Bits, 1, true); APInt G0 = AM.abs(); @@ -1357,9 +1356,7 @@ bool findGCD(unsigned Bits, APInt AM, APInt BM, APInt Delta, return false; } - -static -APInt floorOfQuotient(APInt A, APInt B) { +static APInt floorOfQuotient(const APInt &A, const APInt &B) { APInt Q = A; // these need to be initialized APInt R = A; APInt::sdivrem(A, B, Q, R); @@ -1372,9 +1369,7 @@ APInt floorOfQuotient(APInt A, APInt B) { return Q - 1; } - -static -APInt ceilingOfQuotient(APInt A, APInt B) { +static APInt ceilingOfQuotient(const APInt &A, const APInt &B) { APInt Q = A; // these need to be initialized APInt R = A; APInt::sdivrem(A, B, Q, R); |

