Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,12 @@ void LoopNestOp::gatherWrappers(
wrappers.push_back(wrapper);
parent = parent->getParentOp();
}

// omp.parallel can be misidentified as a loop wrapper when it's not taking
// that role but it contains no other operations in its region (e.g. parallel
// do/for).
if (llvm::isa<omp::ParallelOp>(wrappers.back()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isa is one of the definitions that is also imported into the mlir namespace

Suggested change
if (llvm::isa<omp::ParallelOp>(wrappers.back()))
if (isa<omp::ParallelOp>(wrappers.back()))

wrappers.pop_back();
}

//===----------------------------------------------------------------------===//
Expand Down
Loading