summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2015-02-18 03:43:19 +0000
committerAdam Nemet <anemet@apple.com>2015-02-18 03:43:19 +0000
commit01abb2c35536d13f660d90ebffc8d2e536f0cb87 (patch)
treef514a86bad2961c0751022889b7779603e418f4c /llvm/lib/Analysis
parent3cf32ad6dbb2bb7f72a195c5d60df753e7496380 (diff)
downloadbcm5719-llvm-01abb2c35536d13f660d90ebffc8d2e536f0cb87.tar.gz
bcm5719-llvm-01abb2c35536d13f660d90ebffc8d2e536f0cb87.zip
[LoopAccesses] Make blockNeedsPredication static
blockNeedsPredication is in LoopAccess in order to share it with the vectorizer. It's a utility needed by LoopAccess not strictly provided by it but it's a good place to share it. This makes the function static so that it no longer required to create an LoopAccessInfo instance in order to access it from LV. This was actually causing problems because it would have required creating LAI much earlier that LV::canVectorizeMemory(). This is part of the patchset that converts LoopAccessAnalysis into an actual analysis pass. llvm-svn: 229625
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 6ebb0eff812..ca6e7a83e57 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -931,7 +931,7 @@ void LoopAccessInfo::analyzeLoop(ValueToValueMap &Strides) {
// The TBAA metadata could have a control dependency on the predication
// condition, so we cannot rely on it when determining whether or not we
// need runtime pointer checks.
- if (blockNeedsPredication(ST->getParent()))
+ if (blockNeedsPredication(ST->getParent(), TheLoop, DT))
Loc.AATags.TBAA = nullptr;
Accesses.addStore(Loc);
@@ -968,7 +968,7 @@ void LoopAccessInfo::analyzeLoop(ValueToValueMap &Strides) {
// The TBAA metadata could have a control dependency on the predication
// condition, so we cannot rely on it when determining whether or not we
// need runtime pointer checks.
- if (blockNeedsPredication(LD->getParent()))
+ if (blockNeedsPredication(LD->getParent(), TheLoop, DT))
Loc.AATags.TBAA = nullptr;
Accesses.addLoad(Loc, IsReadOnlyPtr);
@@ -1075,7 +1075,8 @@ void LoopAccessInfo::analyzeLoop(ValueToValueMap &Strides) {
" need a runtime memory check.\n");
}
-bool LoopAccessInfo::blockNeedsPredication(BasicBlock *BB) {
+bool LoopAccessInfo::blockNeedsPredication(BasicBlock *BB, Loop *TheLoop,
+ DominatorTree *DT) {
assert(TheLoop->contains(BB) && "Unknown block used");
// Blocks that do not dominate the latch need predication.
OpenPOWER on IntegriCloud