[PATCH] D156358: [AArch64] Do not unnecessarily spill LR because of @llvm.returnaddress

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 13:58:29 PDT 2023


efriedma added reviewers: arsenm, MatzeB.
efriedma added a comment.
Herald added a subscriber: wdng.

That makes more sense... regalloc sees that you have an operation where the operand and result have to be in the same register, and that register is allocatable, so it doesn't matter if we clobber the value.  Which is right, except that it forces LR to be spilled when the function wouldn't need any spills.

I guess the extra copies introduced by this patch trick the register allocator into not doing that?

I'm not sure what the best way to introduce a hint for that is; maybe setRegAllocationHint() is more appropriate?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156358



More information about the llvm-commits mailing list