benchmarking Poly/ML & floating point
Wed, 13 Sep 2000 15:38:19 -0400 (EDT)
> So, all uses of not will turn into case statements. As long as the result of
> not is always used in a case, then the CPS shrinker will eliminate the not and
> switch the branches on the case. OTOH, examples like the above, where the
> boolean result of not is stored will lead to the extra labels. I guess we could
> add not as a primitive and have a slightly different optimization to switch the
> case labels, but I don't know if it's worth the trouble.
I agree that it probably isn't worth the trouble. Booleans are probably
used for control flow in 90+% of the cases. That being the case, then I
don't think that my peephole optimization would ever be invoked; the only
instances of the not instruction would arise from WordX.not primitives.
Likewise, the only instances of setcc instructions correspond to setting
boolean variables. Since there are no primitive bool to int or bool to
word functions, there will always be intervening control flow
corresponding to the conversion function.