[PATCH] D121539: [AVR] Generate 'rcall' instead of 'call' on avr2 and avr25

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 19:26:52 PDT 2022


benshi001 added a comment.

In D121539#3401092 <https://reviews.llvm.org/D121539#3401092>, @aykevl wrote:

> Looks good to me!
>
> As a possible optimization, you could look into using `rcall` instead of `call` instructions when the target is close enough. For example, here: https://godbolt.org/z/rEz9j71dq (apparently avr-gcc doesn't do this optimization).
>
>   int foo(int a, int b) {
>       return a + b;
>   }
>   
>   int bar(int a, int b) {
>       return foo(a, b) + 3;
>   }
>
> If `-ffunction-sections` is not used, `rcall` is both shorter in code size and faster in execution speed.
> (This is just an idea, unrelated to this patch).

Thanks. I have created an issue to note this task.
https://github.com/llvm/llvm-project/issues/54508


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121539



More information about the llvm-commits mailing list