gtcasl / gpuocelot

GPUOCelot: A dynamic compilation framework for PTX
http://gpuocelot.gatech.edu/
BSD 3-Clause "New" or "Revised" License
280 stars 69 forks source link

StructuralTransform fails on the attached test case. #57

Closed jwang323 closed 9 years ago

jwang323 commented 9 years ago

From rodrigo.d.dominguez@gmail.com on September 14, 2011 16:26:56

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:

Attachment: test.ptx test.pdf test.st.pdf

Original issue: http://code.google.com/p/gpuocelot/issues/detail?id=58

jwang323 commented 9 years ago

From wu.haich...@gmail.com on September 15, 2011 08:24:55

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

jwang323 commented 9 years ago

From rodrigo.d.dominguez@gmail.com on September 15, 2011 09:41:13

Hi Haicheng,

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

jwang323 commented 9 years ago

From wu.haich...@gmail.com on September 15, 2011 19:07:48

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.

jwang323 commented 9 years ago

From rodrigo.d.dominguez@gmail.com on September 16, 2011 05:28:09

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.

Attachment: test.expected.pdf

jwang323 commented 9 years ago

From wu.haich...@gmail.com on September 16, 2011 11:37:58

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.

jwang323 commented 9 years ago

From gregory....@gatech.edu on February 02, 2012 10:01:24

So is this not a bug?

Status: Invalid

jwang323 commented 9 years ago

From rodrigo.d.dominguez@gmail.com on February 02, 2012 10:43:24

I believe this is still an issue.