shrinker

Matthew Fluet fluet@CS.Cornell.EDU
Tue, 20 Nov 2001 19:19:54 -0500 (EST)


> > The SSA shrinker is supposed to get goto's to cases with a known
> > constructor, provided that the only occurrence of the bound variable
> > is in the case test
> 
> I traced through the shrinker on a simple case example and it does
> what I expect.  Can you point to the test where you see it breaking?

I see it in flush_0, which appears in pretty much anything with print.
As a concrete example, with the checked in sources:

fun fib 0 = 1
  | fib 1 = 1
  | fib n = fib (n-1) + fib (n-2)

val n = (fib 20) handle _ => 0

val _ = print (concat ["fib(20) = ",
		       Int.toString n,
		       "\n"])

demonstrates the problem in flush_0.

Also, running a shrink pass at the end of all the SSA simplification
passes does not change the resulting program.