Page MenuHomePhabricator

[SEH] [ARM64] Retrieve the frame pointer from SEH funclets

Authored by ssijaric on Jan 9 2019, 6:29 PM.



The Windows ARM64 runtime passes the establisher frame to funclets as the first argument. This change just copies x1 to fp in that case.

The test case depends on, which lowers the localaddr intrinsic.

Diff Detail


Event Timeline

ssijaric created this revision.Jan 9 2019, 6:29 PM
efriedma added inline comments.Jan 9 2019, 6:51 PM

The casting/stripPointerCasts/hasPersonalityFn is unnecessary here, I think; llvm::classifyEHPersonality will do it for you.

Checking the personality here seems a little awkward, but I guess it works.

ssijaric updated this revision to Diff 181116.Jan 10 2019, 11:24 AM

Cleanup per Eli's comments. Checking for the personality function is probably not necessary. I could add an assert instead of the check?

efriedma added inline comments.Jan 10 2019, 12:27 PM

Do we need to do anything special to recover the base pointer in SEH funclets? (If not, probably worth adding an explicit comment.)

ssijaric updated this revision to Diff 181189.Jan 10 2019, 5:06 PM

Clarify the comment. By looking at cl.exe generated code, it looks like only the frame pointer is passed in x1. The base pointer, if needed, is used directly (e.g. x19). I will verify with a more complicated test case.

efriedma accepted this revision.Jan 10 2019, 5:39 PM



You could probably clean up this testcase a bit (remove the unnecessary attributes, maybe run mem2reg).

This revision is now accepted and ready to land.Jan 10 2019, 5:39 PM
ssijaric closed this revision.Jan 16 2019, 4:33 PM

Committed under Forgot to add a Different Revision line.