diff options
author | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-05-13 21:23:25 +0000 |
---|---|---|
committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-05-13 21:23:25 +0000 |
commit | 963a6d9c69c9d18b57543f751d5de05f9578dc1d (patch) | |
tree | 4ac69e9a4f110f3c5695f1f4c7d41b202501ab82 /llvm/lib/Analysis/LoopUnrollAnalyzer.cpp | |
parent | 16cfe9aa062cfd613684a5fdffc87ed7f98ec850 (diff) | |
download | bcm5719-llvm-963a6d9c69c9d18b57543f751d5de05f9578dc1d.tar.gz bcm5719-llvm-963a6d9c69c9d18b57543f751d5de05f9578dc1d.zip |
Revert "Revert "[Unroll] Implement a conservative and monotonically increasing cost tracking system during the full unroll heuristic analysis that avoids counting any instruction cost until that instruction becomes "live" through a side-effect or use outside the...""
This reverts commit r269395.
Try to reapply with a fix from chapuni.
llvm-svn: 269486
Diffstat (limited to 'llvm/lib/Analysis/LoopUnrollAnalyzer.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopUnrollAnalyzer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp index fe73fe05724..a044e6bd330 100644 --- a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp +++ b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp @@ -189,3 +189,13 @@ bool UnrolledInstAnalyzer::visitCmpInst(CmpInst &I) { return Base::visitCmpInst(I); } + +bool UnrolledInstAnalyzer::visitPHINode(PHINode &PN) { + // Run base visitor first. This way we can gather some useful for later + // analysis information. + if (Base::visitPHINode(PN)) + return true; + + // The loop induction PHI nodes are definitionally free. + return PN.getParent() == L->getHeader(); +} |