CHERIoT-Platform / llvm-project

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

[CHERIoT] Refactor import table generation. #11

Closed davidchisnall closed 10 months ago

davidchisnall commented 10 months ago

This was originally done as an IR->IR transform, to get something working quickly. This was never the correct layer and it was obviously wrong when export tables were generated further down in the back end.

This change moves import table generation to the same place as export table generation. We now record things that need import tables at the point where we generate the load and then emit them at the end.

A few tests are updated because the later expansion changes the order in which import tables are emitted or the register used for the loads.

Aside from the aesthetic improvements, this comes with the following benefits: