kavon / ghc-llvm

improvements to llvm to support functional-language compilers, e.g., ghc
Other
4 stars 0 forks source link

improving cps_ret codegen #9

Open kavon opened 7 years ago

kavon commented 7 years ago

Right now we emit:

LCAFE0:
    movq    (%r13), %rax
    jmpq    *%rax                   ## TAILCALL

for a CPS_RET. We can save an instruction if we add a special pattern as we do for CPSCALLm64 that looks for the load, so that we can emit a TCRETURNmi64 instead, and get:

LCAFE0:
    jmpq    *(%r13)                   ## TAILCALL