aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-09-09 22:00:13 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-09-09 22:00:13 +0000
commitb1c54930cb1450534d6f3f0ebd81eb1e042a3246 (patch)
tree4b76f9c4ee04b2659a7b26b740d407a8271a73dd /lib/Transforms/IPO
parent1d5ad97531a0213f06cc526a0c8ea7b2150f6acc (diff)
downloadexternal_llvm-b1c54930cb1450534d6f3f0ebd81eb1e042a3246.zip
external_llvm-b1c54930cb1450534d6f3f0ebd81eb1e042a3246.tar.gz
external_llvm-b1c54930cb1450534d6f3f0ebd81eb1e042a3246.tar.bz2
Don't shrink atomic ops to bool in GlobalOpt.
LLVM IR doesn't currently allow atomic bool load/store operations, and the transformation is dubious anyway because it isn't profitable on all platforms. PR17163. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 4659271..29c1b6a 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -2046,11 +2046,14 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
// Otherwise, if the global was not a boolean, we can shrink it to be a
// boolean.
- if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue))
- if (TryToShrinkGlobalToBoolean(GV, SOVConstant)) {
- ++NumShrunkToBool;
- return true;
+ if (Constant *SOVConstant = dyn_cast<Constant>(GS.StoredOnceValue)) {
+ if (GS.Ordering == NotAtomic) {
+ if (TryToShrinkGlobalToBoolean(GV, SOVConstant)) {
+ ++NumShrunkToBool;
+ return true;
+ }
}
+ }
}
return false;