relax icon indicating copy to clipboard operation
relax copied to clipboard

[Bug] Some Printer Bugs

Open Hzfengsy opened this issue 3 years ago • 1 comments

In the relax script, the vars with the same name usually are the same var. However, there are two cases that break the rule.

B1 The binding var and function output

@R.function
def func(...):
    with R.dataflow():
        lv = ...
        gv = ...
        R.output(gv)
    return gv

In this case, the gv in gv = ... and the one in return gv can be different. Although it is because I generate the wrong function, the printer at least should distinguish these two vars.

B2 The global var in the module and in the call

@T.prim_func
def func_name():
    ...

@R.function
def main():
    gv = call_tir(func_name, ...)

The GlobalVar func_name in the gv = call_tir(func_name, ...) and that in the IRModule can be the different GlobalVars

I'm not sure if there are other cases that cause similar problems, but it's important to print vars with unique names for both debugging and parsing.

Hzfengsy avatar Mar 23 '22 13:03 Hzfengsy

@Hzfengsy can we check the status of this issue?

tqchen avatar Jan 06 '23 17:01 tqchen