Extended Description
WLSIMP claims to remove/replace at least one class of degenerate WLs.
Specifically, ones generated by this sort of code:
use Array: {genarray,<=,-,+,iota,sel};
int[*] id(int[*] y)
{ return(y);
}
int main()
{
x = id(genarray([10,10],4));
z = with {
(. <= iv <= .) : x[iv] + iota(3);
} : genarray(_shape_A_(x), [1,2, 3]);
return(z[0,0,0]-4);
}
----------------------------------------------
sac2c nested.sac -b11:ivext -nowlur
Produces the following. Note the flat_10 WL bounds:
([ 0, 0 ] <= iv=[_eat_18, _eat_17] < [ _cf_548_x, _cf_547_x ] genwidth [ _cf_548_x, _cf_547_x ])
{
_pinl_227__flat_95 = _sel_VxA_( iv, x);
_flat_10 = with {
([:int] <= _pinl_225_iv < [:int])
{
/* empty */
} : _pinl_227__flat_95 ;
} :
genarray( [:int], _pinl_224__flat_92);
_pinl_237_res = with {
([ 0 ] <= _pinl_234_iv=[_pinl_238__eat_19] < [ 3 ] genwidth [ 3 ])
{
_pinl_236__flat_1072 = _add_SxS_( _flat_10, _pinl_238__eat_19);
} : _pinl_236__flat_1072 ;
} :
genarray( [ 3 ], _pinl_233__flat_1067);
} : _pinl_237_res ;
} :
genarray( [ _cf_548_x, _cf_547_x ], _flat_4);
-------------------------------
It looked to me that WLSIMPwith has a backwards conditional
for this check, but there's more to it than than, because inverting
the test produces poorly flavored goulash.
Not sure how bad these are affecting performance #s.