[llvm] r261954 - [UnitTests] UnrollAnalyzer: make unit-test more general so that it can cover more cases in future.
Michael Zolotukhin via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 25 17:44:05 PST 2016
Author: mzolotukhin
Date: Thu Feb 25 19:44:04 2016
New Revision: 261954
URL: http://llvm.org/viewvc/llvm-project?rev=261954&view=rev
Log:
[UnitTests] UnrollAnalyzer: make unit-test more general so that it can cover more cases in future.
Modified:
llvm/trunk/unittests/Analysis/UnrollAnalyzer.cpp
Modified: llvm/trunk/unittests/Analysis/UnrollAnalyzer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Analysis/UnrollAnalyzer.cpp?rev=261954&r1=261953&r2=261954&view=diff
==============================================================================
--- llvm/trunk/unittests/Analysis/UnrollAnalyzer.cpp (original)
+++ llvm/trunk/unittests/Analysis/UnrollAnalyzer.cpp Thu Feb 25 19:44:04 2016
@@ -32,14 +32,16 @@ struct UnrollAnalyzerTest : public Funct
FI++; // First basic block is entry - skip it.
BasicBlock *Header = &*FI++;
Loop *L = LI->getLoopFor(Header);
+ BasicBlock *Exiting = L->getExitingBlock();
SimplifiedValuesVector.clear();
- TripCount = SE->getSmallConstantTripCount(L, Header);
+ TripCount = SE->getSmallConstantTripCount(L, Exiting);
for (unsigned Iteration = 0; Iteration < TripCount; Iteration++) {
DenseMap<Value *, Constant *> SimplifiedValues;
UnrolledInstAnalyzer Analyzer(Iteration, SimplifiedValues, *SE);
- for (Instruction &I : *Header)
- Analyzer.visit(I);
+ for (auto *BB : L->getBlocks())
+ for (Instruction &I : *BB)
+ Analyzer.visit(I);
SimplifiedValuesVector.push_back(SimplifiedValues);
}
return false;
More information about the llvm-commits
mailing list