summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/Scalar.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2015-05-14 12:05:18 +0000
committerAdam Nemet <anemet@apple.com>2015-05-14 12:05:18 +0000
commit938d3d63d6911a797c553ea8c5faf7ecba47a375 (patch)
tree6c8f18fd487ebdb01abc3276ed33115cff64630d /llvm/lib/Transforms/Scalar/Scalar.cpp
parent605308a42191b0708ce839f960d2b9d52066cc50 (diff)
downloadbcm5719-llvm-938d3d63d6911a797c553ea8c5faf7ecba47a375.tar.gz
bcm5719-llvm-938d3d63d6911a797c553ea8c5faf7ecba47a375.zip
New Loop Distribution pass
Summary: This implements the initial version as was proposed earlier this year (http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/080462.html). Since then Loop Access Analysis was split out from the Loop Vectorizer and was made into a separate analysis pass. Loop Distribution becomes the second user of this analysis. The pass is off by default and can be enabled with -enable-loop-distribution. There is currently no notion of profitability; if there is a loop with dependence cycles, the pass will try to split them off from other memory operations into a separate loop. I decided to remove the control-dependence calculation from this first version. This and the issues with the PDT are actively discussed so it probably makes sense to treat it separately. Right now I just mark all terminator instruction required which keeps identical CFGs for each distributed loop. This seems to be working pretty well for 456.hmmer where even though there is an empty if-then block in the distributed loop initially, it gets completely removed. The pass keeps DominatorTree and LoopInfo updated. I've tested this with -loop-distribute-verify with the testsuite where we distribute ~90 loops. SimplifyLoop is violated in some cases and I have a FIXME covering this. Reviewers: hfinkel, nadav, aschwaighofer Reviewed By: aschwaighofer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8831 llvm-svn: 237358
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Scalar.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/Scalar.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 42095ae261e..483a2997eb8 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -79,6 +79,7 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializePlaceBackedgeSafepointsImplPass(Registry);
initializePlaceSafepointsPass(Registry);
initializeFloat2IntPass(Registry);
+ initializeLoopDistributePass(Registry);
}
void LLVMInitializeScalarOpts(LLVMPassRegistryRef R) {
OpenPOWER on IntegriCloud