summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoadCombine.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-17 23:22:10 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-17 23:22:10 +0000
commit48187cffe2b55d99c655ad38aeca308d02303e95 (patch)
treeccf3f94fefa8ca5683dbf50093ce552e774f1bba /llvm/lib/Transforms/Scalar/LoadCombine.cpp
parenta072d13e5467e7cb0a3d3612c525158b35f03723 (diff)
downloadbcm5719-llvm-48187cffe2b55d99c655ad38aeca308d02303e95.tar.gz
bcm5719-llvm-48187cffe2b55d99c655ad38aeca308d02303e95.zip
[Statistics] Use Statistic::operator+= instead of adding and assigning separately.
I believe this technically fixes a multithreaded race condition in this code. But my primary concern was as part of looking at removing the ability to treat Statistics like a plain unsigned. There are many weird operations on Statistics in the codebase. llvm-svn: 303314
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoadCombine.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoadCombine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoadCombine.cpp b/llvm/lib/Transforms/Scalar/LoadCombine.cpp
index 02215d3450c..494cbc61bc9 100644
--- a/llvm/lib/Transforms/Scalar/LoadCombine.cpp
+++ b/llvm/lib/Transforms/Scalar/LoadCombine.cpp
@@ -228,7 +228,7 @@ bool LoadCombine::combineLoads(SmallVectorImpl<LoadPOPPair> &Loads) {
L.Load->replaceAllUsesWith(V);
}
- NumLoadsCombined = NumLoadsCombined + Loads.size();
+ NumLoadsCombined += Loads.size();
return true;
}
OpenPOWER on IntegriCloud