|
|
Bugzilla Link |
632 |
Created on |
Dec 19, 2009 21:06 |
Resolution |
FIXED |
Resolved on |
Dec 28, 2009 15:12 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
The following code fails, on Build #16885, to move a loop-invariant inner WL
out of the outer WL:
use Array: {genarray,<=,-,+,iota,sel};
int[.,.] id(int[.,.] y, bool foolme)
{
if ( foolme) {
z = genarray([3,3], 42);
} else {
z = y;
}
return(z);
}
int main()
{
x = id(genarray([10,10],4), false);
z = with {
(. <= iv <= .) : x[iv] + iota(3);
} : genarray(_shape_A_(x), [1,2, 3]);
return(z[0,0,0]-4);
}
-------------------------
Instead, we get this:
_flat_3 = false;
_flat_2 = 4;
_flat_1 = [ 10, 10 ];
_pinl_197__flat_49 = [ 0, 0 ];
_flat_0 = with {
(_pinl_197__flat_49 <= _pinl_198_iv=[_pinl_200__eat_24, _pinl_199__eat_23] < _flat_1 genwidth [ 10, 10 ])
{
/* empty */
} : _flat_2 ;
} :
genarray( _flat_1, _flat_2);
x = _MAIN::id( _flat_0, _flat_3);
_isaa_311_x = 2;
_isaa_312_x = _shape_A_( x);
_isaa_313_x = _saabind_( _isaa_311_x, _isaa_312_x, x);
_flat_5 = [ 1, 2, 3 ];
_wlbsc_184_sc_e = _idx_shape_sel_( 0, _isaa_313_x);
_wlbsc_182_sc_e = _idx_shape_sel_( 1, _isaa_313_x);
_wlbsc_185_sc_bound = [ _wlbsc_184_sc_e, _wlbsc_182_sc_e ];
_pinl_226_shp = [ 3 ];
_isaa_314_z = _cat_VxV_( _isaa_312_x, _pinl_226_shp);
z = with {
(_pinl_197__flat_49 <= iv=[_eat_21, _eat_20] < _wlbsc_185_sc_bound genwidth [ _wlbsc_184_sc_e, _wlbsc_182_sc_e ])
{
_pinl_224__flat_104 = _sel_VxA_( iv, _isaa_313_x);
_pinl_235_res = with {
([ 0 ] <= _pinl_232_iv=[_pinl_236__eat_22] < [ 3 ] genwidth [ 3 ])
{
_pinl_234__flat_1204 = _add_SxS_( _pinl_224__flat_104, _pinl_236__eat_22);
} : _pinl_234__flat_1204 ;
} :
genarray( _pinl_226_shp, _isaa_311_x);
} : _pinl_235_res ;
} :
genarray( _isaa_312_x, _flat_5);
_flat_16 = [ 0, 0, 0 ];
_pinl_250__flat_104 = _sel_VxA_( _flat_16, z);
_esd_288 = -4;
_pinl_252__flat_82 = _add_SxS_( _pinl_250__flat_104, _esd_288);
return( _pinl_252__flat_82);