diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-08-15 22:16:46 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-08-15 22:16:46 +0000 |
commit | 211e348eaa7b854287ab6a75df7e03ad56797889 (patch) | |
tree | 5259f5c659dcd0326df5a673a53ce66d568b8f59 /llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | |
parent | faaef9e33469768baeead9c7cddc4b6c236243da (diff) | |
download | bcm5719-llvm-211e348eaa7b854287ab6a75df7e03ad56797889.tar.gz bcm5719-llvm-211e348eaa7b854287ab6a75df7e03ad56797889.zip |
Update inter-procedural optimizations for atomic load/store.
llvm-svn: 137667
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 2dee237e136..e160f63ae35 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -382,7 +382,8 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const { User *U = *UI; Operands.clear(); if (LoadInst *LI = dyn_cast<LoadInst>(U)) { - if (LI->isVolatile()) return false; // Don't hack volatile loads + // Don't hack volatile/atomic loads + if (!LI->isSimple()) return false; Loads.push_back(LI); // Direct loads are equivalent to a GEP with a zero index and then a load. Operands.push_back(0); @@ -410,7 +411,8 @@ bool ArgPromotion::isSafeToPromoteArgument(Argument *Arg, bool isByVal) const { for (Value::use_iterator UI = GEP->use_begin(), E = GEP->use_end(); UI != E; ++UI) if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) { - if (LI->isVolatile()) return false; // Don't hack volatile loads + // Don't hack volatile/atomic loads + if (!LI->isSimple()) return false; Loads.push_back(LI); } else { // Other uses than load? |