reilabs / llvm-to-cairo

Efforts to compile LLVM bytecode to run on top of the CairoVM and hence execute provably on Starknet
http://starknet.io
Apache License 2.0
1 stars 0 forks source link

Design a System for Polyfills #25

Open ktemkin opened 5 days ago

ktemkin commented 5 days ago

Description

Conventionally, LLVM handles mismatches between platform capabilities by using the compiler-rt library. This provides the basic level of platform support expected by LLVM IR. This effort will effectively require an implementation of this functionality, but the exact form of this support library is to be determined.

The primary task here is to determine how we want to make these polyfills available to the compiled code (#24), and also how the polyfills should be structured in a uniform fashion. It also needs to work out how we plan to compile the polyfills into the same (FlatLowered?) representation as the compiled LLVM IR.

We want to make the system heavily modular so that new polyfills can be added without having to change the polyfill system or the way the polyfills are emitted.