This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Don't emit save-restore call if function is a interrupt handler
ClosedPublic

Authored by Jim on Apr 15 2021, 12:53 AM.

Details

Summary

It has to save all caller-saved registers before a call in the handler.
So don't emit a call that save/restore registers.

Diff Detail

Event Timeline

Jim created this revision.Apr 15 2021, 12:53 AM
Jim requested review of this revision.Apr 15 2021, 12:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2021, 12:53 AM

This LGTM, I've left a note on a potential comment update, but otherwise looks good

llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h
63

Can you update this comment to put , or is an interrupt handler

Jim updated this revision to Diff 337668.Apr 15 2021, 2:05 AM

Address comment

luismarques accepted this revision.Apr 15 2021, 2:31 AM

Thanks, good catch. LGTM.

I wonder if this test should just go in the existing saverestore.ll test?

This revision is now accepted and ready to land.Apr 15 2021, 2:31 AM
asb accepted this revision.Apr 15 2021, 3:17 AM
Jim updated this revision to Diff 337689.Apr 15 2021, 3:28 AM

Address @luismarques's comment

simoncook accepted this revision.Apr 15 2021, 3:49 AM
jrtc27 added inline comments.Apr 15 2021, 5:04 AM
llvm/test/CodeGen/RISCV/saverestore.ll
304

Inline the attribute

Jim updated this revision to Diff 337727.Apr 15 2021, 5:40 AM

Address @jrtc27's comment.