Set flag to true when definition is emitted. (#97)

This commit is contained in:
Gheorghe-Teodor Bercea 2020-02-25 09:47:42 -05:00 committed by GitHub
parent a720f9a7b2
commit 0d307d1183
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -168,6 +168,8 @@ void BuildKrnlLoop::createDefineAndOptimizeOp(bool withEmptyOptimization) {
originalLoops.reserve(originalLoopNum);
for (auto result : loopsOp.getResults())
originalLoops.push_back(result);
createdDefineOp = true;
// inserte optimize loop op.
auto optimizedLoopsOp =
rewriter.create<KrnlOptimizeLoopsOp>(loc, originalLoopNum);
@ -182,9 +184,10 @@ void BuildKrnlLoop::createDefineAndOptimizeOp(bool withEmptyOptimization) {
rewriter.create<KrnlReturnLoopsOp>(loc, originalLoops);
rewriter.restoreInsertionPoint(ip);
}
createdOptimizeOp = true;
// prepare data structure to push bounds
pack = new KrnlIterateOperandPack(rewriter, originalLoops, optLoops);
createdOptimizeOp = true;
}
// push bounds (lower and upper) and return index for loop info