CHERIoT-Platform / llvm-project

Fork of LLVM adding CHERIoT, based on the CHERI LLVM fork
4 stars 6 forks source link

Fix machine outlining for CHERIoT #46

Open resistor opened 1 week ago

resistor commented 1 week ago

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:

Unfortunately, there's no simple way to fix this. A few options are:

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.

resistor commented 1 week ago

https://github.com/resistor/llvm-project-1/commit/05503ed587d1688fa46ef75513de70da7f145bbe

davidchisnall commented 1 week ago

See CHERIoT-Platform/cheriot-sail#85

resistor commented 1 day ago

On the CheriotRTOS test suite, re-enabling MachineOutlining reduces code size by approximately 4.4%