AWLF defeated by unknown array shape
|
|
Bugzilla Link |
861 |
Created on |
Aug 25, 2011 18:13 |
Resolution |
FIXED |
Resolved on |
Sep 12, 2011 21:17 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
This is unit test ~/sac/testsuite/optimizations/awlf/subarray1dAKD.sac:
use Array: {drop,iota,sum};
int[*] id(int[*] y)
{
return(y);
}
int main()
{
XXX = iota(id (50));
YYY = drop([20], XXX);
ZZZ = sum(YYY);
z = _sub_SxS_(ZZZ, 1035);
return(z);
}
-----------------------------------------------------
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 17569:MODIFIED linux-gnu_x86_64
(Thu Aug 25 13:10:01 EDT 2011 by sac)
AWLF should be able to fold this into a single WL, but it
fails to do so, because it can't determine if:
( 20 - id(50)) < 0
This leaves the value behind a CONDfun, which defeats AWLF.
Although this is a contrived unit test, I can conceive
of such code arising in practice.