This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][OMPT] Introduce a guard to handle OMPT return address
ClosedPublic

Authored by protze.joachim on Nov 18 2020, 2:34 AM.

Details

Summary

This is an alternative approach to address inconsistencies pointed out in: D90078
This patch makes sure that the return address is reset, when leaving the scope.
In some cases, I had to move the macro out of an if-statement to have it in the right scope, in some cases I added an additional block to restrict the scope.

This patch does not handle inconsistencies, which might occur if the return address is still set when we call into the application.

In general, I would prefer to pass the address down the stack as function arguments, which is not possible with all the internal calls to external API functions

Diff Detail

Event Timeline

protze.joachim created this revision.Nov 18 2020, 2:34 AM
protze.joachim requested review of this revision.Nov 18 2020, 2:34 AM
hbae accepted this revision.Nov 20 2020, 7:57 AM

Looks good to me for the issue I am concerning about. Here is a test that passes with this patch.

This revision is now accepted and ready to land.Nov 20 2020, 7:57 AM

This broke building with OMPT disabled, but I went ahead and pushed a fix for that in 6b429668ded1aa7de4d586fc6dc8a469799b4d9c, by moving OmptReturnAddressGuard to inside the OMPT_SUPPORT ifdef.

This broke building with OMPT disabled, but I went ahead and pushed a fix for that in 6b429668ded1aa7de4d586fc6dc8a469799b4d9c, by moving OmptReturnAddressGuard to inside the OMPT_SUPPORT ifdef.

Thanks!
This reminds me to include a no-OMPT test pass into my pre-push tests.