This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpenMP][IRBuilder] Add support for nowait on single construct
ClosedPublic

Authored by shraiysh on Mar 23 2022, 11:15 PM.

Details

Summary

This patch adds the nowait parameter to createSingle in
OpenMPIRBuilder and handling for IR generation from OpenMP Dialect.

Also added tests for the same.

Diff Detail

Event Timeline

shraiysh created this revision.Mar 23 2022, 11:15 PM
Herald added a project: Restricted Project. · View Herald Transcript
shraiysh requested review of this revision.Mar 23 2022, 11:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
ftynse accepted this revision.Mar 24 2022, 3:00 AM
This revision is now accepted and ready to land.Mar 24 2022, 3:00 AM
This revision was landed with ongoing or failed builds.Mar 24 2022, 10:22 AM
This revision was automatically updated to reflect the committed changes.
probinson added inline comments.
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
2954

It seems this EXPECT_FALSE is never executed, causing it to be flagged in my "Rotten Green Tests" work. Perhaps the loop could be rewritten to be more similar to the ThenBB check?

CallInst *ExitCI = nullptr;
for (auto &FI : *ExitBB) {
  Instruction *cur = &FI;
  if (auto CI = dyn_cast<CallInst>(cur)) {
    if (CI->getCalledFunction()->getName() == "__kmpc_barrier") {
      ExitCI = CI;
      break;
    }
  }
}
EXPECT_EQ(ExitCI, nullptr);