shrinker

Matthew Fluet fluet@CS.Cornell.EDU
Tue, 20 Nov 2001 16:26:36 -0500 (EST)


What's planned for the shrinker?  Looking through some .dot files, I've
seen the eta gotos.  Also, there instances like

  L_275 (x_353)
    x_351 = Vector_fromArray (x_361)
    x_357 = Vector_length (x_351)
    x_360 = Int_lt (x_334, global_2)
    case x_360 of
      false => L_273 | true => L_274
  L_274 ()
    L_272 (global_3)
  L_273 ()
    x_359 = Int_lt (x_353, global_2)
    L_272 (x_359)
  L_272 (x_358)
    case x_358 of
      false => L_270 | true => L_271
  L_271 ()
    L_269 (global_3)
  L_270 ()
    x_356 = Int_sub (x_357, x_353)
    x_355 = Int_gt (x_334, x_356)
    L_269 (x_355)
  L_269 (x_354)
    case x_354 of
      false => L_267 | true => L_268
  L_268 ()
    raise (global_4)
  L_267 ()
    x_352 = Int_add (x_334, x_353)
    x_350 = Int_sub (x_352, x_334)
    x_335 = Posix_IO_write (global_7, x_351, x_334, x_350)
    x_349 = MLton_eq (x_335, global_14)
    case x_349 of
      false => L_253 | true => L_266

It's easier to see in a dot file, but each of those L_??? (global_3)
basically pass "true" onto an if branch.  Looking at the same functions in
cps, I don't see things like this, so maybe there was something in the
CPS shrinker that got them.

No big deal, though.  Something like this should be subsumed by a
known-case analysis/transformation, which should work on all datatypes,
not just bools.  

Also, does/will/should the shrinker restore the SSA condition if a
transformation breaks it?  My guess is not, since so far no transformation
has needed it.