Skip to content

[AVR] Optimize 'call' to 'rcall' for short programs #54508

Closed
@ghost

Description

As a possible optimization, we 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.

Metadata

Metadata

Assignees

Labels

backend:AVRclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions