Open qdbplang opened 1 year ago
One potential way is to do:
-Xclang -disable-O0-optnone
optiontailcc
calling conventioninvoke_<n>
be force inlined and all their invocations of code be tailcalled w/ tailccopt
with --passes=tailcallelim
Something that will potentially simplify things is if we put everything into one file.
We should implement this with qdbp :)
Mark all invoke fns as optnone and always inline
Insert inline asm as annotation. Mark all definitions as tailcc
Run tail call elimination pass and remove optnone annotations
You can just tailcc mark all metbods and method calls. No need for inline asm
Currently, we compile with clang -O2. Unfortunately, while most(all?) of the time clang will optimize tail calls, it is not a guarantee. We should alter the produced LLVM IR to force TCO.