diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-08-15 20:54:19 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-08-15 20:54:19 +0000 |
commit | 667ccf231b57857ea9e36f1d93bd895242d58284 (patch) | |
tree | 2fb62ad6e8f5bb11cc1247e3bc31ee99f5eeea99 /lib/Analysis/LoopDependenceAnalysis.cpp | |
parent | 47a24ab4d72dc0f78c2027327cb9a69d6de2bbcd (diff) |
Misc analysis passes that need to be aware of atomic load/store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopDependenceAnalysis.cpp')
-rw-r--r-- | lib/Analysis/LoopDependenceAnalysis.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Analysis/LoopDependenceAnalysis.cpp b/lib/Analysis/LoopDependenceAnalysis.cpp index c1afe8fbd6..3997ac478b 100644 --- a/lib/Analysis/LoopDependenceAnalysis.cpp +++ b/lib/Analysis/LoopDependenceAnalysis.cpp @@ -76,7 +76,13 @@ static void GetMemRefInstrs(const Loop *L, } static bool IsLoadOrStoreInst(Value *I) { - return isa<LoadInst>(I) || isa<StoreInst>(I); + // Returns true if the load or store can be analyzed. Atomic and volatile + // operations have properties which this analysis does not understand. + if (LoadInst *LI = dyn_cast<LoadInst>(I)) + return LI->isUnordered(); + else if (StoreInst *SI = dyn_cast<StoreInst>(I)) + return SI->isUnordered(); + return false; } static Value *GetPointerOperand(Value *I) { |