EPalmas345 / gpuocelot

Automatically exported from code.google.com/p/gpuocelot
0 stars 0 forks source link

StructuralTransform fails on the attached test case. #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
StructuralTransform fails on the attached test case. I used tools/CFG to 
produce the attached control flow graphs. The right transformation would clone 
BB_1_0009. The attached files are:

- test.ptx: the input file to CFG
- test.pdf: the output of CFG w/o structural transformation
- test.st.pdf: the output of CFG with structural transformation

Original issue reported on code.google.com by rodrigo.d.dominguez@gmail.com on 14 Sep 2011 at 8:26

Attachments:

GoogleCodeExporter commented 9 years ago
My structural analysis treat test.st.pdf as structured. 

BB3, BB4, BB10 form an if-then
BB6, BB7, BB10_cloned form an if-then
BB3, BB4, BB10, BB5 are then sequential blocks
BB6, BB7, BB10_cloned, BB8 are also sequential block
BB2, BB3, BB4, BB10, BB5, BB6, BB7, BB10_cloned, BB8 are then a if-then-else

Original comment by wu.haich...@gmail.com on 15 Sep 2011 at 3:24

GoogleCodeExporter commented 9 years ago
Hi Haicheng,

I don't see how BB3, BB4, and BB10 form an if-then.

Original comment by rodrigo.d.dominguez@gmail.com on 15 Sep 2011 at 4:41

GoogleCodeExporter commented 9 years ago
I treat

if(x)
  exit();

as an if-then module.

As to lexical order, my implementation does not require it.  I run an 
structural analysis (Muchnick 7.7) to detect the program structure. 

Original comment by wu.haich...@gmail.com on 16 Sep 2011 at 2:07

GoogleCodeExporter commented 9 years ago
You can't treat it as an if-then because it has a side exit (to the end of the 
function in this case). I am attaching a graph with the expected result from 
Zhang's algorithm.

Original comment by rodrigo.d.dominguez@gmail.com on 16 Sep 2011 at 12:28

Attachments:

GoogleCodeExporter commented 9 years ago
For simplicity, I do not treat exit node as a special node. So it does not have 
to appear in the end of the function and there may be multiple exit nodes.

Original comment by wu.haich...@gmail.com on 16 Sep 2011 at 6:37

GoogleCodeExporter commented 9 years ago
So is this not a bug?

Original comment by gregory....@gatech.edu on 2 Feb 2012 at 6:01

GoogleCodeExporter commented 9 years ago
I believe this is still an issue.

Original comment by rodrigo.d.dominguez@gmail.com on 2 Feb 2012 at 6:43