[PATCH] D54498: AbstractCallSite -- A unified interface for (in)direct and callback calls
Siddharth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 14 09:57:13 PST 2018
bollu added a comment.
I have a question in the context of optimising sequential programs -- I'm interested in optimising across a trampoline call, since I have a haskell-like lazy language, which lowers CPS into LLVM-IR by constructing a trampoline. Example IR here <https://gist.github.com/bollu/8834682e5970550afcd6a0c991777fe1#file-ackermann-ll-L220> Some salient features are:
- All functions are `musttail`, and communicate data by custom "stacks" which are allocated on the heap.
- LLVM manages to remove some of the trampoline code, but it's still super messy (I can generate a clean version where the trampoline is visible)
Would the `AbstractCallSite` representation allow one to represent the control flow between:
trampoline -> fn1 -> trampoline -> fn2 -> ...
And could this infrastructure help implement a pass that would resolve these custom stack pushes and pops?
Thanks, and sorry for the somewhat unstructured comment. I'm asking this question as a Haskeller interested in representing laziness within LLVM.
Repository:
rL LLVM
https://reviews.llvm.org/D54498
More information about the llvm-commits
mailing list