This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Correct the CallPreservedMask for the function call in an interrupt handler
ClosedPublic

Authored by shiva0217 on Feb 14 2020, 2:10 AM.

Details

Summary

The patch fix the issue mentioned in https://bugs.llvm.org/show_bug.cgi?id=42984.

CallPreservedMask is used to describe the register liveness after a function call. The function call in an interrupt handler should use the same CallPreservedMask as normal functions. So that only callee save registers can live through the function call.

Diff Detail

Event Timeline

shiva0217 created this revision.Feb 14 2020, 2:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2020, 2:10 AM
lenary accepted this revision.Feb 14 2020, 5:33 AM

LGTM. it now makes more sense why getCallPreservedMask and getCalleeSavedRegs are not direct inverses of each other.

This revision is now accepted and ready to land.Feb 14 2020, 5:33 AM

@shiva0217 This is probably a fix that needs backporting to the 10.0 branch. I'll let alex make the final call on that though.

luismarques added inline comments.Feb 14 2020, 5:38 AM
llvm/test/CodeGen/RISCV/interrupt-attr-callee.ll
10

Typo "funciton".

shiva0217 updated this revision to Diff 244794.Feb 14 2020, 5:05 PM

Update the patch to fix the typo.

shiva0217 closed this revision.Feb 14 2020, 5:34 PM

Hi @lenary and @luismarques,
Thanks for the review.

@shiva0217 I see you've closed this revision - has it landed, or not yet?

Hi @lenary,

The patch has landed with https://github.com/llvm/llvm-project/commit/1cae2f9d192c69833e22684ca338660942ab464e. I forgot to add the "Differential Revision:" in the commit message, so I closed the revision manually. Sorry for the inconvenience.

asb added a subscriber: hans.Feb 20 2020, 5:51 AM

@hans this patch fixes a reported bug https://bugs.llvm.org/show_bug.cgi?id=42984 and is non-invasive. I'd be in favour of cherry-picking for 10.0 if you're ok with that.

hans added a comment.Feb 20 2020, 6:17 AM
In D74596#1884474, @asb wrote:

@hans this patch fixes a reported bug https://bugs.llvm.org/show_bug.cgi?id=42984 and is non-invasive. I'd be in favour of cherry-picking for 10.0 if you're ok with that.

Sounds good, pushed as 4bcdac8d762794d822819eb6d207a0630c345d0b.