CSE & CF wanted in phase 10
|
|
Bugzilla Link |
628 |
Created on |
Dec 16, 2009 22:10 |
Resolution |
FIXED |
Resolved on |
Dec 19, 2009 21:20 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
When I compile this:
use Array:{+,-};
int[*] id(int[*] y)
{
return(y);
}
int main()
{
q = id(666);
z = with {
} : genarray( [id(20)], q+42);
z = _sel_VxA_([3], z) - 708;
return(z);
}
I get this output from Phase 10:adp:
_flat_1 = 666;
q = _MAIN::id( _flat_1);
_flat_14 = 20;
_flat_13 = _MAIN::id( _flat_14);
_flat_12 = [ _flat_13 ];
_flat_11 = 20;
_flat_10 = _MAIN::id( _flat_11);
_flat_9 = [ _flat_10 ];
_flat_8 = 0;
_flat_7 = _mul_SxV_( _flat_8, _flat_9);
_flat_6 = 42;
_flat_5 = ScalarArith::+( q, _flat_6);
_flat_4 = 20;
_flat_3 = _MAIN::id( _flat_4);
_flat_2 = [ _flat_3 ];
z = with {
(_flat_7 <= _hzgwl_0=[_eat_20] < _flat_12)
{
_flat_16 = 42;
_flat_15 = ScalarArith::+( q, _flat_16);
} : _flat_15 ; ,
default partition( _hzgwl_0=[_eat_20] ):
{
/* empty */
} : _flat_5 ;
} :
genarray( _flat_2, _flat_5);
The fact that _flat_2 and _flat_12 are the same, but are not
the same, causes WLPG to decide that it has to build extra
partitions to cover the result array.
This may be part of the cause of run-time performance loss
post-Loch Ness.
Adding a CSE call before WLPG will fix that problem, but it's not
enough to fix the call to TULSisFullGenerator to make it properly
detect that the no extra partitions are needed.
First, TULSisFullGenerator is checking for constants in the generator
bounds. This means that ALL AKD code will fail this check.
Second, the check for a zero lower bound is defeated by
the computation of _flat_7, which needs a CF call to turn into
a constant.
I'm trying this now, and will see what effect that produces.