#pragma for WL no longer works in matmul()
|
|
Bugzilla Link |
1117 |
Created on |
Feb 24, 2014 17:32 |
Resolution |
FIXED |
Resolved on |
Feb 24, 2014 20:20 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Attachments |
matmul.sac |
Extended Description
Created an attachment (id=1005)
source code to reproduce fault
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 18429 linux-gnu_x86_64
(Mon Feb 24 11:22:37 EST 2014 by sac)
In my modified copy of ~/sac/demos/applications/numerical/misc/matmul.sac,
the pragma is ignored. More to the point, WITH_PRAGMA disappears
from the AST during the DCR after -bopt:cyc:wlf:2.
I modified the test because the only reference to the result of the
matmul is: C[0,0]. SCWLF does a fold on this, which effectively
evaporates the entire benchmark. If I compile with -noscwlf,
then the pragma works as expected.
I replaced the C[0,0] with sum(C). AWLF/WLF fold the pragma-marked WL
into the sum WL, at which point the WITH_PRAGMA is sitting in dead code.
There are a few problems here, IMO:
1. Any pragma in a producer-WL disappear when that WL is folded into
a consumer-WL. Since sum() is a stdlib function, we would have to
give the sum() a pragma, which doesn't seem quite right.
We might consider copying the WITH_PRAGMA from the producer-WL into
a NULL WITH_PRAGMA for the consumer-WL. I don't know whether this
is a good or bad idea. Comments welcome.
2. A pragma is only effective at the outermost level of WL nesting,
if WLF/AWLF can occur.
I have added a comment to matmul.sac re -noscwlf.