|
|
Bugzilla Link |
966 |
Created on |
Jun 03, 2012 15:03 |
Resolution |
FIXED |
Resolved on |
Jun 03, 2012 22:08 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
I have this PETL unit test:
bool[*] cond( bool[*] y)
{
z = false;
if( y) {
z = true;
}
return(z);
}
int[*] akd( int[*] y)
{ return(y);
}
int main ()
{
rep = akd( 25);
rep = _max_SxS_( rep, 42);
if( cond(true)) {
z = _gt_SxS_( rep, 25);
} else {
z = false;
}
z = _toi_S_(z);
z = _sub_SxS_( z, 1);
return(z);
}
My expectation is that, within the COND_0 function's TRUE leg, that we
would eliminate the _gt_SxS_() because, with PETL, we know that rep has
a value of of at least 42.
However, what I see after several rounds of this:
sac2c -V
sac2c v1.00-beta (Haggis And Apple)
developer rev 17861 linux-gnu_x86_64
(Sat Jun 2 17:16:14 EDT 2012 by sac)
sac@rattler:~/sac/testsuite/optimizations/petl$ sac2c condfun.sac -doawlf -nowlf -dopetl -doedfa-v1 -bopt:saacyc:etv:3 > lof3
is this, within the CONDFUN:
bool _MAIN::main__Cond_1( int{42} _petl_744_rep__SSA0_1 { dim: 0, shape: [:int],NN } , int rep { dim: 0, shape: [:int],NN, minval: _petl_744_rep__SSA0_1 } , bool _flat_2 { dim: 0, shape: [:int],NN } )
/*
* main__Cond_1 :: ---
*/
{
int _ivexp_1865 { , NN } ;
int{-25} _esd_461 { dim: 0, shape: [:int], NN } ;
int _ctz_458 { dim: 0, shape: [:int], YN, minval: _ivexp_1865 } ;
int{0} _ctz_459 { dim: 0, shape: [:int], NN } ;
bool z__SSA0_2 { dim: 0, shape: [:int], NN } ;
bool{0} z__SSA0_1 { dim: 0, shape: [:int], NN } ;
bool z { dim: 0, shape: [:int], NN } ;
if (_flat_2)
{
_esd_461 = -25;
_ivexp_1865 = _add_SxS_( _petl_744_rep__SSA0_1, _esd_461);
_ctz_458 = _add_SxS_( rep, _esd_461);
_ctz_459 = 0;
z = _gt_SxS_( _ctz_458, _ctz_459);
...
The computation of _ivexp_1865 is on AKV arguments, but TC is
not seeing that, apparently, as the result is AKS.
What's up?