plt/racket — pull request #761 by gus-massa (2014-08-26 13:06:13+00:00)
Title: optimizer: move the equal? => eq? transformation to the optimizer phase

For some types, (equal? x y) is transformed into (eq? x y) in the resolve phase.
This commit moves this transformation to the optimizer phase. This improves
constant folding and enable some optimizations that are prevented
because equal? can run arbitrary code.

Also, transform (eq? #f x) => (not x) and (eq? '() x) => (null? x) to use
the type information of x when it's known.

---

scheme_eq_testable_constant: I added a few constants and changed the fixnum range from 1<<29 to 1<<30.

make_optimize_prim_application2: I still don't like the name. Too long to inline by hand, too weird for a short name. Another possibility is to add to optimize_application2 a rand_already_optimized argument.

---

This branch has one main commit and two "optional" commits that should be squashed if approved.