[PATCH] D84737: [AArch64][SVE] Preserve full vector regs over EH edge.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 12:34:16 PDT 2020


sdesmalen added a comment.

In D84737#2216322 <https://reviews.llvm.org/D84737#2216322>, @rsandifo-arm wrote:

> Thanks the update, the idea looks good in general.

Thanks for the feedback!

> Two questions though:
>
> - Is it worth having two functions?  I thought it might be simpler to have just `getCustomEHPadPreservedMask()`, with nullptr meaning “no clobbers”.

The reason I had two functions at first was because `TargetRegisterInfo::getCallPreservedMask()` returns `nullptr` as well, but in that case this means "clobbers everything", where for this function it means the opposite. I have changed the default now, and clarified the default in the comment of the method declaration.

> - It looks from the tests like the function isn't saving or restoring z8-z23 and p4-p15, is that right?  That's fine for landing pads that can't return directly to the callee (e.g. because they rethrow).  But in these tests the landing pad does return to the caller.  Since the extra callee-saved registers are clobbered on the EH edge, we need to save and restore those registers ourselves on control paths that include an EH edge and a return.

Yes you're right, thanks for pointing that out! I have fixed that in the latest revision by calling `addPhysRegsUsedFromRegMask` for the mask returned by `getCustomEHPadPreservedMask`. I tried doing this for the mask returned by `MachineBasicBlock::getBeginClobberMask` (which seemed to me like the right thing to do considering it's name), but that broke mosts tests for Windows EH (on both AArch64 as well as X86).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84737/new/

https://reviews.llvm.org/D84737



More information about the llvm-commits mailing list