mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
[UnitTests] UnrollAnalyzer: make unit-test more general so that it can cover more cases in future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261954 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5e86c5c682
commit
30deba6b59
@ -32,14 +32,16 @@ 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)
|
||||
Analyzer.visit(I);
|
||||
for (auto *BB : L->getBlocks())
|
||||
for (Instruction &I : *BB)
|
||||
Analyzer.visit(I);
|
||||
SimplifiedValuesVector.push_back(SimplifiedValues);
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user