Page MenuHomePhabricator

AArch64: support @llvm.{return,frame}address in GlobalISel
AcceptedPublic

Authored by t.p.northover on Fri, Aug 2, 6:55 AM.

Details

Reviewers
aemerson
Summary

These intrinsics expand to a variable number of instructions so just like in ISelLowering.cpp we use custom code to deal with them.

Diff Detail

Event Timeline

t.p.northover created this revision.Fri, Aug 2, 6:55 AM
aemerson accepted this revision.Fri, Aug 2, 10:50 AM

LGTM with test nit.

llvm/test/CodeGen/AArch64/GlobalISel/select-frameaddr.ll
1

If you're going to use an llc test can you add -global-isel-abort=1 -verify-machineinstrs too.

This revision is now accepted and ready to land.Fri, Aug 2, 10:50 AM
aemerson added inline comments.Fri, Aug 2, 10:54 AM
llvm/test/CodeGen/AArch64/GlobalISel/select-frameaddr.ll
1

s/llc/.ll

arsenm added a subscriber: arsenm.Fri, Aug 2, 9:12 PM
arsenm added inline comments.
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
4025

Should backends be directly consuming intrinsics like this? I would expect these to be lowered earlier, and select to never deal with a generic intrinsic

aemerson added inline comments.Fri, Aug 2, 10:30 PM
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
4025

What else could these be lowered to?

t.p.northover marked an inline comment as done.Mon, Aug 5, 7:20 AM
t.p.northover added inline comments.
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
4025

You could probably just about expand everything in terms of @llvm.frameaddress(i32 0), but it would be pretty target-specific and not terribly efficient for @llvm.returnaddress(i32 0).