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/unittests/Analysis | |
| 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/unittests/Analysis')
| -rw-r--r-- | llvm/unittests/Analysis/UnrollAnalyzer.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/unittests/Analysis/UnrollAnalyzer.cpp b/llvm/unittests/Analysis/UnrollAnalyzer.cpp index 83d57f52469..6d11ab1f2f1 100644 --- a/llvm/unittests/Analysis/UnrollAnalyzer.cpp +++ b/llvm/unittests/Analysis/UnrollAnalyzer.cpp @@ -134,6 +134,7 @@ TEST(UnrollAnalyzerTest, OuterLoopSimplification) { " br label %outer.loop\n" "outer.loop:\n" " %iv.outer = phi i64 [ 0, %entry ], [ %iv.outer.next, %outer.loop.latch ]\n" + " %iv.outer.next = add nuw nsw i64 %iv.outer, 1\n" " br label %inner.loop\n" "inner.loop:\n" " %iv.inner = phi i64 [ 0, %outer.loop ], [ %iv.inner.next, %inner.loop ]\n" @@ -141,7 +142,6 @@ TEST(UnrollAnalyzerTest, OuterLoopSimplification) { " %exitcond.inner = icmp eq i64 %iv.inner.next, 1000\n" " br i1 %exitcond.inner, label %outer.loop.latch, label %inner.loop\n" "outer.loop.latch:\n" - " %iv.outer.next = add nuw nsw i64 %iv.outer, 1\n" " %exitcond.outer = icmp eq i64 %iv.outer.next, 40\n" " br i1 %exitcond.outer, label %exit, label %outer.loop\n" "exit:\n" @@ -163,11 +163,15 @@ TEST(UnrollAnalyzerTest, OuterLoopSimplification) { BasicBlock *InnerBody = &*FI++; BasicBlock::iterator BBI = Header->begin(); - Instruction *Y1 = &*BBI++; + BBI++; + Instruction *Y1 = &*BBI; BBI = InnerBody->begin(); - Instruction *Y2 = &*BBI++; + BBI++; + Instruction *Y2 = &*BBI; // Check that we can simplify IV of the outer loop, but can't simplify the IV // of the inner loop if we only know the iteration number of the outer loop. + // + // Y1 is %iv.outer.next, Y2 is %iv.inner.next auto I1 = SimplifiedValuesVector[0].find(Y1); EXPECT_TRUE(I1 != SimplifiedValuesVector[0].end()); auto I2 = SimplifiedValuesVector[0].find(Y2); |

