forked from OSchip/llvm-project
[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:
parent
e704aa4f25
commit
793c29a267
|
@ -399,13 +399,13 @@ ModuleTranslation::convertOmpParallel(Operation &opInst,
|
|||
llvm::Instruction *codeGenIPBBTI = codeGenIPBB->getTerminator();
|
||||
|
||||
builder.SetInsertPoint(codeGenIPBB);
|
||||
|
||||
for (auto ®ion : 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 ®ion = 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
|
||||
|
|
Loading…
Reference in New Issue