Open SchrodingerZhu opened 2 months ago
@anqurvanillapy @Lancern @CyanPineapple Please be aware of current pipeline.
@QuarticCat please notify me when you start to implement the missing passes.
Not fully related to this issue, but do we have or plan to have a documentation page that explains the ops, types, passes, etc. in ReuseIR just like any other MLIR dialects do?
I would like to have one. I don't yet know how to generate the document from tablegen. Could you check that?
I would like to have one. I don't yet know how to generate the document from tablegen. Could you check that?
Let me work on this. Opening a new issue to track this.
Opening a new issue to track this.
Tracked in #69 .
-reuse-ir-closure-outlining
outlines closure creations intovtable
and other operations.-reuse-ir-insert-acquire-release
(unimplemented) ping @QuarticCat-reuse-ir-token-reuse
uses available tokens to replaceTokenAllocOp
-reuse-ir-infer-union-tag
is a helper pass to cut off branches on union types if it has a known variant.acquire-release-fusion
is conservative about complicated branches (at lease for now).-reuse-ir-expand-control-flow=outline-nested-release=0
expands one layer of hidden control flows due torelease
,destroy
and other operations. This will expose therelease
operations insidedestroy
for fusion.-reuse-ir-acquire-release-fusion
fuses consecutive acquire/release on precisely aliased RC pointers.-reuse-ir-expand-control-flow=outline-nested-release=1
converts the remainingrelease/destroy
operations into outlined functions (notice that some drop routines are possibly recursive).After the above:
convert-scf-to-cf
converts structured control flow to branches among basic blocks.convert-reuse-ir-to-llvm
lowers whatever remains inreuse_ir
down to LLVM dialect. (Not complete)convert-arith-to-llvm
(and other passes of needed) lowersarith
operations.Then, translate mlir to LLVMIR:
Then, obtain the optimized machine code