This is an archive of the discontinued LLVM Phabricator instance.

[flang] Upstream partial lowering of EXIT intrinsic
ClosedPublic

Authored by josh.mottley.arm on Jan 25 2022, 6:27 AM.

Details

Summary

This patch adds partial lowering of the "EXIT" intrinsic to
the backend runtime hook implemented in patch D110741. It also adds a
helper function to the RuntimeCallTestBase.h for testing for an
intrinsic function call in a mlir::Block.

Diff Detail

Event Timeline

josh.mottley.arm requested review of this revision.Jan 25 2022, 6:27 AM

Thanks @josh.mottley.arm , comments inline!

flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h
123–126

Could you refine this a bit?

  • "Check the operations in \p block for containing a fir::CallOp operation where its name matches \p fctName" -> this suggests that the name of fir::CallOp should be fctName, but in fact it's the function that fir::CallOp calls that's matched against fctName
  • This method will only check the first instance of fir::CallOpt(fctName)and exit, right? I think that that's fine, but worth documenting too.
127–142

A bit more context:

  • EXPECT_TRUE(block); --> I would move this to where the block is created. In this function I'd use assertinstead (to verify that this method is used correctly)
  • you don't really need opFound :)
  • everything else is a "nit" - feel free to ignore

Addressed awarzynski comments.

josh.mottley.arm marked 2 inline comments as done.Jan 26 2022, 8:28 AM
josh.mottley.arm added inline comments.
flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h
123–126

Is this comment better?

awarzynski accepted this revision.Jan 28 2022, 10:10 AM

Thanks for addressing my comments! LGTM

flang/unittests/Optimizer/Builder/Runtime/StopTest.cpp
15
19

nit

This revision is now accepted and ready to land.Jan 28 2022, 10:10 AM
josh.mottley.arm marked an inline comment as done.

Addressed awarzynski comments.

josh.mottley.arm marked 2 inline comments as done.Feb 1 2022, 2:13 AM
schweitz accepted this revision.Feb 1 2022, 9:31 AM