diff options
author | Adam Nemet <anemet@apple.com> | 2015-11-03 23:50:03 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2015-11-03 23:50:03 +0000 |
commit | 397f5829c7c8d64c3c0edc3e07535835ad35262a (patch) | |
tree | 9c07d7f0c8cdf76b254685bdaa8b9fcb5382e5d0 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | ed653d6774cd449fc6f803d21b5d3164f8c10c5b (diff) | |
download | bcm5719-llvm-397f5829c7c8d64c3c0edc3e07535835ad35262a.tar.gz bcm5719-llvm-397f5829c7c8d64c3c0edc3e07535835ad35262a.zip |
[LAA] LLE 5/6: Add predicate functions Dependence::isForward/isBackward, NFC
Summary: Will be used by the LoopLoadElimination pass.
Reviewers: hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13258
llvm-svn: 252016
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index fd85a908ffb..58a7d08860b 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -910,14 +910,14 @@ bool MemoryDepChecker::Dependence::isSafeForVectorization(DepType Type) { llvm_unreachable("unexpected DepType!"); } -bool MemoryDepChecker::Dependence::isPossiblyBackward() const { +bool MemoryDepChecker::Dependence::isBackward() const { switch (Type) { case NoDep: case Forward: case ForwardButPreventsForwarding: + case Unknown: return false; - case Unknown: case BackwardVectorizable: case Backward: case BackwardVectorizableButPreventsForwarding: @@ -926,6 +926,26 @@ bool MemoryDepChecker::Dependence::isPossiblyBackward() const { llvm_unreachable("unexpected DepType!"); } +bool MemoryDepChecker::Dependence::isPossiblyBackward() const { + return isBackward() || Type == Unknown; +} + +bool MemoryDepChecker::Dependence::isForward() const { + switch (Type) { + case Forward: + case ForwardButPreventsForwarding: + return true; + + case NoDep: + case Unknown: + case BackwardVectorizable: + case Backward: + case BackwardVectorizableButPreventsForwarding: + return false; + } + llvm_unreachable("unexpected DepType!"); +} + bool MemoryDepChecker::couldPreventStoreLoadForward(unsigned Distance, unsigned TypeByteSize) { // If loads occur at a distance that is not a multiple of a feasible vector |