This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Emit 'eicall' for devices with large program memory
ClosedPublic

Authored by benshi001 on Jan 21 2023, 9:50 PM.

Diff Detail

Event Timeline

benshi001 created this revision.Jan 21 2023, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2023, 9:50 PM
Herald added subscribers: Jim, hiraditya. · View Herald Transcript
benshi001 requested review of this revision.Jan 21 2023, 9:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2023, 9:50 PM
benshi001 added inline comments.Jan 21 2023, 9:55 PM
llvm/test/CodeGen/AVR/issue-58856-eicall.ll
22

This form is incompatible with avr-gcc, avr-gcc emits lo8(gs(sym)) and hi8(gs(sym)). However this is another issue, at least clang+llvm generates correct relocable and executable ELFs.

aykevl accepted this revision.Jan 22 2023, 1:53 PM

Looks good to me.

The inline assembly is perhaps a bit confusing. What I would do is split this function into two functions: one returns @func as a function pointer, and the other with a single function pointer parameter that is called. Feel free to do that or leave as is.

This revision is now accepted and ready to land.Jan 22 2023, 1:53 PM