[MLIR,OpenMP][NFCI] Removed loop for accessing regions of ParallelOp

`ParallelOp` has only one region associated with it.

Reviewed By: kiranchandramohan, ftynse

Differential Revision: https://reviews.llvm.org/D85008
This commit is contained in:
Sourabh Singh Tomar 2020-07-31 18:52:12 +05:30
parent e704aa4f25
commit 793c29a267
1 changed files with 7 additions and 8 deletions

View File

@ -399,13 +399,13 @@ ModuleTranslation::convertOmpParallel(Operation &opInst,
llvm::Instruction *codeGenIPBBTI = codeGenIPBB->getTerminator();
builder.SetInsertPoint(codeGenIPBB);
for (auto &region : opInst.getRegions()) {
for (auto &bb : region) {
auto *llvmBB = llvm::BasicBlock::Create(
llvmContext, "omp.par.region", codeGenIP.getBlock()->getParent());
blockMapping[&bb] = llvmBB;
}
// ParallelOp has only `1` region associated with it.
auto &region = cast<omp::ParallelOp>(opInst).getRegion();
for (auto &bb : region) {
auto *llvmBB = llvm::BasicBlock::Create(
llvmContext, "omp.par.region", codeGenIP.getBlock()->getParent());
blockMapping[&bb] = llvmBB;
}
// Then, convert blocks one by one in topological order to ensure
// defs are converted before uses.
@ -433,7 +433,6 @@ ModuleTranslation::convertOmpParallel(Operation &opInst,
// Finally, after all blocks have been traversed and values mapped,
// connect the PHI nodes to the results of preceding blocks.
connectPHINodes(region, valueMapping, blockMapping);
}
};
// TODO: Perform appropriate actions according to the data-sharing