[SOLVED] How to get output variables from Function or Block

I wanna get output variables from IRModule.Function or block of Function.body. However, I have no see any method to get.

According to the investigation, IRModule.Function.body is a SeqExpr, and the SeqExpr.body corresponds to the output of the Function.

Therefore, to obtain the output of a Function named func, you can access it through func.body.body.

More detailed evidence as below in BlockBuilder::emit_func_output:

1 Like