Open kumasento opened 3 years ago
One possible solution:
i
will be renamed to i_2
if it appears the second time. All the subsequent statements that refer to this instance of i
will be replaced its actual usage to i_2
. In this way, we get a symbol table that contains all the unique instances of each IV.S0(i)
to S0(i_2)
if necessary, and leave the iterators field as it is. Such that we can figure out the mapping when finally processing the clast in ConvertFromOpenScop
.S0(i)
uses as its argument, which could be i
, i_2
, or i_3
.
Sometimes Pluto may generate a Scop like this:
When it is handled by CLooG, there might be duplicated loop structures that iterate the polyhedra. In that case, the same statement can exist at different places in the code. For different placement, they could have exactly the same naming for their loop IVs, however, if so, our code that generates MLIR from Scop cannot handle well since it relies the fact that IV names to be unique.
We might need to fundamentally change the design of the symbol table. Or maybe we need to add a new pass to make things easier to handle.
Also note that there are conflicts in the naming of the statements as well. For instance, one S1 can be different places of the code due to Pluto and CLooG.