forked from OSchip/llvm-project
[UnitTests] UnrollAnalyzer: make unit-test more general so that it can cover more cases in future.
llvm-svn: 261954
This commit is contained in:
parent
970bb9e0ec
commit
374651d9aa
|
@ -32,13 +32,15 @@ struct UnrollAnalyzerTest : public FunctionPass {
|
|||
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)
|
||||
for (auto *BB : L->getBlocks())
|
||||
for (Instruction &I : *BB)
|
||||
Analyzer.visit(I);
|
||||
SimplifiedValuesVector.push_back(SimplifiedValues);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue