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 | 3d30b435e2b3d0e7480019577f48472b51133c21 (patch) | |
tree | a053c08e7439a16cda926881d2bb1bd2f557e89d /lib/Transforms/IPO/ArgumentPromotion.cpp | |
parent | cc4a0435b7ee34af2c64a6f7ee63642f56096d1b (diff) | |
download | llvm-3d30b435e2b3d0e7480019577f48472b51133c21.tar.gz llvm-3d30b435e2b3d0e7480019577f48472b51133c21.tar.bz2 llvm-3d30b435e2b3d0e7480019577f48472b51133c21.tar.xz |
Update inter-procedural optimizations for atomic load/store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r-- | lib/Transforms/IPO/ArgumentPromotion.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp index 2dee237e13..e160f63ae3 100644 --- a/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/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? |