diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2013-09-09 22:00:13 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2013-09-09 22:00:13 +0000 |
commit | 33d370071673b400d6a71e63be2f7dd37f07d4d6 (patch) | |
tree | 9837470f0324ed2be993bf4a453966d712c7c3b1 /llvm/lib | |
parent | 4a204d26c574e6b9c0d4cd4ae6202519234492fc (diff) | |
download | bcm5719-llvm-33d370071673b400d6a71e63be2f7dd37f07d4d6.tar.gz bcm5719-llvm-33d370071673b400d6a71e63be2f7dd37f07d4d6.zip |
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.
llvm-svn: 190357
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 46592711214..29c1b6a6c94 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/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; |