forked from CTSRD-CHERI/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix machine outlining for CHERIoT #46
Comments
resistor
added a commit
to resistor/llvm-project-1
that referenced
this issue
Nov 13, 2024
See CHERIoT-Platform#46 for details.
resistor
changed the title
Implement machine outlining for CHERIoT
Fix machine outlining for CHERIoT
Nov 13, 2024
resistor
added a commit
to resistor/llvm-project-1
that referenced
this issue
Nov 13, 2024
See CHERIoT-Platform#46 for details.
sleffler
pushed a commit
to sleffler/llvm-project
that referenced
this issue
Nov 14, 2024
See CHERIoT-Platform#46 for details.
resistor
added a commit
to resistor/llvm-project-1
that referenced
this issue
Nov 20, 2024
See CHERIoT-Platform#46 for details.
resistor
added a commit
to resistor/llvm-project-1
that referenced
this issue
Nov 20, 2024
See CHERIoT-Platform#46 for details.
On the CheriotRTOS test suite, re-enabling MachineOutlining reduces code size by approximately 4.4% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As an embedded platform, we would very much like to reap the code size benefits of MachineOutliner. However, for the moment MachineOutliner is disabled for CHERIoT, as it does not interact well with the backwards sentries used for call/return on CHERIoT. Specifically:
ct0
as a scratch register, both to materialize the outlined function address prior to the call, as well as to hold the return address for the duration of the call to the outlined function. The outlined outlined function then returns throughct0
back to the original function. Notice that this does not usecra
, the normal link register.cjal
orcjalr
instruction that produces a link output, regardless of what register it writes to, always produces a backward sentryotype
.cjalr
used in the outlined function expects a differentotype
based on the source register used: forcra
it expects a sealed backward sentry, but for all other registers it expects a sealed forward sentry.Unfortunately, there's no simple way to fix this. A few options are:
cra
is dead so we can scavenge it.The AArch64 backend actually implements all three of these strategies, as an optimization to attain minimal code size. It might make sense to port these strategies from AArch64 to RISCV in upstream, and then have CHERIoT bail out of outlining only when those strategies fail.
The text was updated successfully, but these errors were encountered: