diff --git a/collects/tests/typed-scheme/optimizer/missed-optimizations/precision-loss.rkt b/collects/tests/typed-scheme/optimizer/missed-optimizations/precision-loss.rkt index 8cee92c2..b9f1bac9 100644 --- a/collects/tests/typed-scheme/optimizer/missed-optimizations/precision-loss.rkt +++ b/collects/tests/typed-scheme/optimizer/missed-optimizations/precision-loss.rkt @@ -1,11 +1,10 @@ #; ( -precision-loss.rkt 21:3 (#%app * (quote 3/4) (quote 2/3)) -- exact arithmetic subexpression inside a float expression, extra precision discarded -- caused by: 21:0 (#%app + (#%app * (quote 3/4) (quote 2/3)) (quote 2.0)) -precision-loss.rkt 25:3 (#%app - (quote 3/4)) -- exact arithmetic subexpression inside a float expression, extra precision discarded -- caused by: 25:0 (#%app + (#%app - (quote 3/4)) (quote 2.0)) -precision-loss.rkt 33:8 (#%app * (quote 3/4) (quote 2/3)) -- binary, args all float-arg-expr, return type not Float -- caused by: 33:11 (quote 3/4) -precision-loss.rkt 33:0 (#%app * (#%app * (quote 3/4) (quote 2/3)) (quote 2.0)) -- binary, args all float-arg-expr, return type not Float -- caused by: 33:8 (#%app * (quote 3/4) (quote 2/3)) -precision-loss.rkt 33:8 (#%app * (quote 3/4) (quote 2/3)) -- exact arithmetic subexpression inside a float expression, extra precision discarded -- caused by: 33:0 (#%app * (#%app * (quote 3/4) (quote 2/3)) (quote 2.0)) -precision-loss.rkt 33:8 (#%app * (quote 3/4) (quote 2/3)) -- binary, args all float-arg-expr, return type not Float -- caused by: 33:11 (quote 3/4) +precision-loss.rkt 20:3 (#%app * (quote 3/4) (quote 2/3)) -- exact arithmetic subexpression inside a float expression, extra precision discarded -- caused by: 20:0 (#%app + (#%app * (quote 3/4) (quote 2/3)) (quote 2.0)) +precision-loss.rkt 24:3 (#%app - (quote 3/4)) -- exact arithmetic subexpression inside a float expression, extra precision discarded -- caused by: 24:0 (#%app + (#%app - (quote 3/4)) (quote 2.0)) +precision-loss.rkt 32:8 (#%app * (quote 3/4) (quote 2/3)) -- binary, args all float-arg-expr, return type not Float -- caused by: 32:11 (quote 3/4) +precision-loss.rkt 32:0 (#%app * (#%app * (quote 3/4) (quote 2/3)) (quote 2.0)) -- binary, args all float-arg-expr, return type not Float -- caused by: 32:8 (#%app * (quote 3/4) (quote 2/3)) +precision-loss.rkt 32:8 (#%app * (quote 3/4) (quote 2/3)) -- exact arithmetic subexpression inside a float expression, extra precision discarded -- caused by: 32:0 (#%app * (#%app * (quote 3/4) (quote 2/3)) (quote 2.0)) 2.5 2.75 1.25 diff --git a/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt b/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt index d17ad864..21234c07 100644 --- a/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt @@ -1,17 +1,11 @@ #; ( #f (no location) car -- pair -#f (no location) car -- pair -derived-pair.rkt 23:0 (#%app caar (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3))) -- derived pair -#f (no location) car -- pair +derived-pair.rkt 17:0 (#%app caar (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3))) -- derived pair #f (no location) cdr -- pair -derived-pair.rkt 24:0 (#%app cadr (#%app cons (quote 1) (#%app cons (quote 2) (quote 3)))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair.rkt 25:0 (#%app cdar (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair.rkt 26:0 (#%app cddr (#%app cons (quote 1) (#%app cons (quote 2) (quote 3)))) -- derived pair +derived-pair.rkt 18:0 (#%app cadr (#%app cons (quote 1) (#%app cons (quote 2) (quote 3)))) -- derived pair +derived-pair.rkt 19:0 (#%app cdar (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3))) -- derived pair +derived-pair.rkt 20:0 (#%app cddr (#%app cons (quote 1) (#%app cons (quote 2) (quote 3)))) -- derived pair 1 2 2 diff --git a/collects/tests/typed-scheme/optimizer/tests/derived-pair2.rkt b/collects/tests/typed-scheme/optimizer/tests/derived-pair2.rkt index fe6959f8..c80814cf 100644 --- a/collects/tests/typed-scheme/optimizer/tests/derived-pair2.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/derived-pair2.rkt @@ -1,37 +1,15 @@ #; ( #f (no location) car -- pair -#f (no location) car -- pair -#f (no location) car -- pair -derived-pair2.rkt 47:0 (#%app caaar (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4))) -- derived pair -#f (no location) car -- pair -#f (no location) car -- pair +derived-pair2.rkt 25:0 (#%app caaar (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4))) -- derived pair #f (no location) cdr -- pair -derived-pair2.rkt 48:0 (#%app caadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)))) -- derived pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair2.rkt 49:0 (#%app cadar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4))) -- derived pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair2.rkt 50:0 (#%app caddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) car -- pair -derived-pair2.rkt 51:0 (#%app cdaar (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -derived-pair2.rkt 52:0 (#%app cdadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair2.rkt 53:0 (#%app cddar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair2.rkt 54:0 (#%app cdddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))))) -- derived pair +derived-pair2.rkt 26:0 (#%app caadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)))) -- derived pair +derived-pair2.rkt 27:0 (#%app cadar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4))) -- derived pair +derived-pair2.rkt 28:0 (#%app caddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))))) -- derived pair +derived-pair2.rkt 29:0 (#%app cdaar (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4))) -- derived pair +derived-pair2.rkt 30:0 (#%app cdadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)))) -- derived pair +derived-pair2.rkt 31:0 (#%app cddar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4))) -- derived pair +derived-pair2.rkt 32:0 (#%app cdddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))))) -- derived pair 1 2 2 diff --git a/collects/tests/typed-scheme/optimizer/tests/derived-pair3.rkt b/collects/tests/typed-scheme/optimizer/tests/derived-pair3.rkt index d893831c..bb6ee5e9 100644 --- a/collects/tests/typed-scheme/optimizer/tests/derived-pair3.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/derived-pair3.rkt @@ -1,85 +1,23 @@ #; ( #f (no location) car -- pair -#f (no location) car -- pair -#f (no location) car -- pair -#f (no location) car -- pair -derived-pair3.rkt 103:0 (#%app caaaar (#%app cons (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4)) (quote 5))) -- derived pair -#f (no location) car -- pair -#f (no location) car -- pair -#f (no location) car -- pair +derived-pair3.rkt 41:0 (#%app caaaar (#%app cons (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4)) (quote 5))) -- derived pair #f (no location) cdr -- pair -derived-pair3.rkt 104:0 (#%app caaadr (#%app cons (quote 1) (#%app cons (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)) (quote 5)))) -- derived pair -#f (no location) car -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair3.rkt 105:0 (#%app caadar (#%app cons (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4))) (quote 5))) -- derived pair -#f (no location) car -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 106:0 (#%app caaddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (#%app cons (quote 3) (quote 4)) (quote 5))))) -- derived pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) car -- pair -derived-pair3.rkt 107:0 (#%app cadaar (#%app cons (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4)) (quote 5))) -- derived pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 108:0 (#%app cadadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))) (quote 5)))) -- derived pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair3.rkt 109:0 (#%app caddar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4)))) (quote 5))) -- derived pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 110:0 (#%app cadddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (#%app cons (quote 4) (quote 5)))))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) car -- pair -#f (no location) car -- pair -derived-pair3.rkt 111:0 (#%app cdaaar (#%app cons (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4)) (quote 5))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 112:0 (#%app cdaadr (#%app cons (quote 1) (#%app cons (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)) (quote 5)))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair3.rkt 113:0 (#%app cdadar (#%app cons (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4))) (quote 5))) -- derived pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 114:0 (#%app cdaddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (#%app cons (quote 3) (quote 4)) (quote 5))))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) car -- pair -derived-pair3.rkt 115:0 (#%app cddaar (#%app cons (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4)) (quote 5))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 116:0 (#%app cddadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))) (quote 5)))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) car -- pair -derived-pair3.rkt 117:0 (#%app cdddar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4)))) (quote 5))) -- derived pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -#f (no location) cdr -- pair -derived-pair3.rkt 118:0 (#%app cddddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (#%app cons (quote 4) (quote 5)))))) -- derived pair +derived-pair3.rkt 42:0 (#%app caaadr (#%app cons (quote 1) (#%app cons (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)) (quote 5)))) -- derived pair +derived-pair3.rkt 43:0 (#%app caadar (#%app cons (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4))) (quote 5))) -- derived pair +derived-pair3.rkt 44:0 (#%app caaddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (#%app cons (quote 3) (quote 4)) (quote 5))))) -- derived pair +derived-pair3.rkt 45:0 (#%app cadaar (#%app cons (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4)) (quote 5))) -- derived pair +derived-pair3.rkt 46:0 (#%app cadadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))) (quote 5)))) -- derived pair +derived-pair3.rkt 47:0 (#%app caddar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4)))) (quote 5))) -- derived pair +derived-pair3.rkt 48:0 (#%app cadddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (#%app cons (quote 4) (quote 5)))))) -- derived pair +derived-pair3.rkt 49:0 (#%app cdaaar (#%app cons (#%app cons (#%app cons (#%app cons (quote 1) (quote 2)) (quote 3)) (quote 4)) (quote 5))) -- derived pair +derived-pair3.rkt 50:0 (#%app cdaadr (#%app cons (quote 1) (#%app cons (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4)) (quote 5)))) -- derived pair +derived-pair3.rkt 51:0 (#%app cdadar (#%app cons (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (quote 3)) (quote 4))) (quote 5))) -- derived pair +derived-pair3.rkt 52:0 (#%app cdaddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (#%app cons (quote 3) (quote 4)) (quote 5))))) -- derived pair +derived-pair3.rkt 53:0 (#%app cddaar (#%app cons (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (quote 3))) (quote 4)) (quote 5))) -- derived pair +derived-pair3.rkt 54:0 (#%app cddadr (#%app cons (quote 1) (#%app cons (#%app cons (quote 2) (#%app cons (quote 3) (quote 4))) (quote 5)))) -- derived pair +derived-pair3.rkt 55:0 (#%app cdddar (#%app cons (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (quote 4)))) (quote 5))) -- derived pair +derived-pair3.rkt 56:0 (#%app cddddr (#%app cons (quote 1) (#%app cons (quote 2) (#%app cons (quote 3) (#%app cons (quote 4) (quote 5)))))) -- derived pair 1 2 2 diff --git a/collects/tests/typed-scheme/optimizer/tests/fixnum-bounded-expr.rkt b/collects/tests/typed-scheme/optimizer/tests/fixnum-bounded-expr.rkt index ebd24eb8..e49e1213 100644 --- a/collects/tests/typed-scheme/optimizer/tests/fixnum-bounded-expr.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/fixnum-bounded-expr.rkt @@ -18,8 +18,6 @@ fixnum-bounded-expr.rkt 87:9 + -- fixnum bounded expr fixnum-bounded-expr.rkt 87:1 fx+ -- fixnum fx+ fixnum-bounded-expr.rkt 88:6 + -- fixnum bounded expr fixnum-bounded-expr.rkt 88:18 + -- fixnum bounded expr -fixnum-bounded-expr.rkt 88:6 + -- fixnum bounded expr -fixnum-bounded-expr.rkt 88:18 + -- fixnum bounded expr fixnum-bounded-expr.rkt 90:6 + -- fixnum bounded expr fixnum-bounded-expr.rkt 90:18 + -- fixnum bounded expr fixnum-bounded-expr.rkt 90:1 fx- -- fixnum fx- @@ -50,6 +48,8 @@ fixnum-bounded-expr.rkt 99:1 fxabs -- fixnum fxabs 4 ) + + #lang typed/racket #:optimize diff --git a/collects/tests/typed-scheme/optimizer/tests/float-complex-fixnum.rkt b/collects/tests/typed-scheme/optimizer/tests/float-complex-fixnum.rkt index 4fe63e2a..c7377a7f 100644 --- a/collects/tests/typed-scheme/optimizer/tests/float-complex-fixnum.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/float-complex-fixnum.rkt @@ -1,13 +1,11 @@ #; ( -float-complex-fixnum.rkt 17:4 modulo -- binary nonzero fixnum -float-complex-fixnum.rkt 17:4 modulo -- binary nonzero fixnum -float-complex-fixnum.rkt 17:4 modulo -- binary nonzero fixnum -float-complex-fixnum.rkt 17:3 (#%app modulo (quote 2) (quote 1)) -- float-coerce-expr in complex ops -float-complex-fixnum.rkt 17:16 1.0+2.0i -- unboxed literal -float-complex-fixnum.rkt 17:25 3.0+6.0i -- unboxed literal -float-complex-fixnum.rkt 17:1 + -- unboxed binary float complex -float-complex-fixnum.rkt 17:0 (#%app + (#%app modulo (quote 2) (quote 1)) (quote 1.0+2.0i) (quote 3.0+6.0i)) -- unboxed float complex +float-complex-fixnum.rkt 15:4 modulo -- binary nonzero fixnum +float-complex-fixnum.rkt 15:3 (#%app modulo (quote 2) (quote 1)) -- float-coerce-expr in complex ops +float-complex-fixnum.rkt 15:16 1.0+2.0i -- unboxed literal +float-complex-fixnum.rkt 15:25 3.0+6.0i -- unboxed literal +float-complex-fixnum.rkt 15:1 + -- unboxed binary float complex +float-complex-fixnum.rkt 15:0 (#%app + (#%app modulo (quote 2) (quote 1)) (quote 1.0+2.0i) (quote 3.0+6.0i)) -- unboxed float complex 4.0+8.0i ) diff --git a/collects/tests/typed-scheme/optimizer/tests/float-complex-parts2.rkt b/collects/tests/typed-scheme/optimizer/tests/float-complex-parts2.rkt index 8e5c927d..126c4b54 100644 --- a/collects/tests/typed-scheme/optimizer/tests/float-complex-parts2.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/float-complex-parts2.rkt @@ -1,37 +1,25 @@ #; ( -float-complex-parts2.rkt 46:14 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 46:23 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 46:12 + -- unboxed binary float complex -float-complex-parts2.rkt 46:11 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex -float-complex-parts2.rkt 46:14 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 46:23 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 46:12 + -- unboxed binary float complex -float-complex-parts2.rkt 46:1 real-part -- unboxed float complex -float-complex-parts2.rkt 47:23 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 47:32 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 47:21 + -- unboxed binary float complex -float-complex-parts2.rkt 47:20 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex -float-complex-parts2.rkt 47:23 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 47:32 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 47:21 + -- unboxed binary float complex -float-complex-parts2.rkt 47:1 unsafe-flreal-part -- unboxed float complex -float-complex-parts2.rkt 48:14 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 48:23 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 48:12 + -- unboxed binary float complex -float-complex-parts2.rkt 48:11 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex -float-complex-parts2.rkt 48:14 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 48:23 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 48:12 + -- unboxed binary float complex -float-complex-parts2.rkt 48:1 imag-part -- unboxed float complex -float-complex-parts2.rkt 49:23 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 49:32 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 49:21 + -- unboxed binary float complex -float-complex-parts2.rkt 49:20 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex -float-complex-parts2.rkt 49:23 1.0+2.0i -- unboxed literal -float-complex-parts2.rkt 49:32 2.0+4.0i -- unboxed literal -float-complex-parts2.rkt 49:21 + -- unboxed binary float complex -float-complex-parts2.rkt 49:1 unsafe-flimag-part -- unboxed float complex +float-complex-parts2.rkt 34:14 1.0+2.0i -- unboxed literal +float-complex-parts2.rkt 34:23 2.0+4.0i -- unboxed literal +float-complex-parts2.rkt 34:12 + -- unboxed binary float complex +float-complex-parts2.rkt 34:11 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex +float-complex-parts2.rkt 34:1 real-part -- unboxed float complex +float-complex-parts2.rkt 35:23 1.0+2.0i -- unboxed literal +float-complex-parts2.rkt 35:32 2.0+4.0i -- unboxed literal +float-complex-parts2.rkt 35:21 + -- unboxed binary float complex +float-complex-parts2.rkt 35:20 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex +float-complex-parts2.rkt 35:1 unsafe-flreal-part -- unboxed float complex +float-complex-parts2.rkt 36:14 1.0+2.0i -- unboxed literal +float-complex-parts2.rkt 36:23 2.0+4.0i -- unboxed literal +float-complex-parts2.rkt 36:12 + -- unboxed binary float complex +float-complex-parts2.rkt 36:11 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex +float-complex-parts2.rkt 36:1 imag-part -- unboxed float complex +float-complex-parts2.rkt 37:23 1.0+2.0i -- unboxed literal +float-complex-parts2.rkt 37:32 2.0+4.0i -- unboxed literal +float-complex-parts2.rkt 37:21 + -- unboxed binary float complex +float-complex-parts2.rkt 37:20 (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)) -- unboxed float complex +float-complex-parts2.rkt 37:1 unsafe-flimag-part -- unboxed float complex 3.0 3.0 6.0 diff --git a/collects/tests/typed-scheme/optimizer/tests/float-promotion.rkt b/collects/tests/typed-scheme/optimizer/tests/float-promotion.rkt index e69dfad9..9467d9db 100644 --- a/collects/tests/typed-scheme/optimizer/tests/float-promotion.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/float-promotion.rkt @@ -1,9 +1,8 @@ #; ( -float-promotion.rkt 14:4 modulo -- binary nonzero fixnum -float-promotion.rkt 14:4 modulo -- binary nonzero fixnum +float-promotion.rkt 13:4 modulo -- binary nonzero fixnum +float-promotion.rkt 13:1 + -- binary float float-promotion.rkt 14:1 + -- binary float -float-promotion.rkt 15:1 + -- binary float 2.0 1e+200 ) diff --git a/collects/tests/typed-scheme/optimizer/tests/invalid-unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/tests/invalid-unboxed-let.rkt index d0202372..39c00e20 100644 --- a/collects/tests/typed-scheme/optimizer/tests/invalid-unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/invalid-unboxed-let.rkt @@ -1,36 +1,24 @@ #; ( -invalid-unboxed-let.rkt 38:14 t1 -- unbox float-complex -invalid-unboxed-let.rkt 38:17 t1 -- unbox float-complex -invalid-unboxed-let.rkt 38:12 + -- unboxed binary float complex -invalid-unboxed-let.rkt 38:11 (#%app + t1 t1) -- unboxed float complex -invalid-unboxed-let.rkt 38:14 t1 -- unbox float-complex -invalid-unboxed-let.rkt 38:17 t1 -- unbox float-complex -invalid-unboxed-let.rkt 38:12 + -- unboxed binary float complex -invalid-unboxed-let.rkt 38:11 (#%app + t1 t1) -- unboxed float complex -invalid-unboxed-let.rkt 38:14 t1 -- unbox float-complex -invalid-unboxed-let.rkt 38:17 t1 -- unbox float-complex -invalid-unboxed-let.rkt 38:12 + -- unboxed binary float complex -invalid-unboxed-let.rkt 38:11 (#%app + t1 t1) -- unboxed float complex -invalid-unboxed-let.rkt 34:13 1.0+2.0i -- unboxed literal -invalid-unboxed-let.rkt 34:22 2.0+4.0i -- unboxed literal -invalid-unboxed-let.rkt 34:11 + -- unboxed binary float complex -invalid-unboxed-let.rkt 35:13 3.0+6.0i -- unboxed literal -invalid-unboxed-let.rkt 35:22 4.0+8.0i -- unboxed literal -invalid-unboxed-let.rkt 35:11 + -- unboxed binary float complex -invalid-unboxed-let.rkt 35:10 (#%app + (quote 3.0+6.0i) (quote 4.0+8.0i)) -- unboxed float complex -invalid-unboxed-let.rkt 34:0 (let-values (((t1) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i))) ((t2) (#%app + (quote 3.0+6.0i) (quote 4.0+8.0i))) ((t3) (quote 1.0+2.0i)) ((t4) (quote 1))) (#%app display (#%app + t1 t1)) (#%app display t2) (#%app display t3) (#%app display t4)) -- unboxed let bindings -invalid-unboxed-let.rkt 38:14 t1 -- leave var unboxed -invalid-unboxed-let.rkt 38:17 t1 -- leave var unboxed -invalid-unboxed-let.rkt 38:12 + -- unboxed binary float complex -invalid-unboxed-let.rkt 38:11 (#%app + t1 t1) -- unboxed float complex +invalid-unboxed-let.rkt 26:14 t1 -- unbox float-complex +invalid-unboxed-let.rkt 26:17 t1 -- unbox float-complex +invalid-unboxed-let.rkt 26:12 + -- unboxed binary float complex +invalid-unboxed-let.rkt 26:11 (#%app + t1 t1) -- unboxed float complex +invalid-unboxed-let.rkt 22:13 1.0+2.0i -- unboxed literal +invalid-unboxed-let.rkt 22:22 2.0+4.0i -- unboxed literal +invalid-unboxed-let.rkt 22:11 + -- unboxed binary float complex +invalid-unboxed-let.rkt 23:13 3.0+6.0i -- unboxed literal +invalid-unboxed-let.rkt 23:22 4.0+8.0i -- unboxed literal +invalid-unboxed-let.rkt 23:11 + -- unboxed binary float complex +invalid-unboxed-let.rkt 23:10 (#%app + (quote 3.0+6.0i) (quote 4.0+8.0i)) -- unboxed float complex +invalid-unboxed-let.rkt 22:0 (let-values (((t1) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i))) ((t2) (#%app + (quote 3.0+6.0i) (quote 4.0+8.0i))) ((t3) (quote 1.0+2.0i)) ((t4) (quote 1))) (#%app display (#%app + t1 t1)) (#%app display t2) (#%app display t3) (#%app display t4)) -- unboxed let bindings +invalid-unboxed-let.rkt 26:14 t1 -- leave var unboxed +invalid-unboxed-let.rkt 26:17 t1 -- leave var unboxed 6.0+12.0i7.0+14.0i1.0+2.0i1) #lang typed/scheme #:optimize - - (let ((t1 (+ 1.0+2.0i 2.0+4.0i)) ; can be unboxed (t2 (+ 3.0+6.0i 4.0+8.0i)) ; can't be unboxed (t3 1.0+2.0i) ; can't be unboxed diff --git a/collects/tests/typed-scheme/optimizer/tests/nested-let-loop.rkt b/collects/tests/typed-scheme/optimizer/tests/nested-let-loop.rkt index d9bd9876..4e304f80 100644 --- a/collects/tests/typed-scheme/optimizer/tests/nested-let-loop.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/nested-let-loop.rkt @@ -1,49 +1,42 @@ #; ( -nested-let-loop.rkt 56:38 r -- unbox float-complex -nested-let-loop.rkt 56:40 s -- unbox float-complex -nested-let-loop.rkt 56:36 + -- unboxed binary float complex -nested-let-loop.rkt 56:35 (#%app + r s) -- unboxed float complex -nested-let-loop.rkt 49:8 r -- unboxed var -> table -nested-let-loop.rkt 47:6 loop1 -- unboxed function -> table -nested-let-loop.rkt 47:6 loop1 -- fun -> unboxed fun -nested-let-loop.rkt 51:10 r -- unboxed complex variable -nested-let-loop.rkt 56:38 r -- leave var unboxed -nested-let-loop.rkt 56:40 s -- unbox float-complex -nested-let-loop.rkt 56:36 + -- unboxed binary float complex -nested-let-loop.rkt 56:35 (#%app + r s) -- unboxed float complex -nested-let-loop.rkt 54:18 s -- unboxed var -> table -nested-let-loop.rkt 52:16 loop2 -- unboxed function -> table -nested-let-loop.rkt 52:16 loop2 -- fun -> unboxed fun -nested-let-loop.rkt 56:38 r -- leave var unboxed -nested-let-loop.rkt 56:40 s -- leave var unboxed -nested-let-loop.rkt 56:36 + -- unboxed binary float complex -nested-let-loop.rkt 56:21 loop1 -- unboxed call site -nested-let-loop.rkt 56:28 cdr -- pair -nested-let-loop.rkt 56:21 loop1 -- call to fun with unboxed args -nested-let-loop.rkt 57:38 s -- leave var unboxed -nested-let-loop.rkt 57:40 (#%app car x) -- unbox float-complex -nested-let-loop.rkt 57:41 car -- pair -nested-let-loop.rkt 57:48 (#%app car y) -- unbox float-complex -nested-let-loop.rkt 57:49 car -- pair -nested-let-loop.rkt 57:36 + -- unboxed binary float complex -nested-let-loop.rkt 57:21 loop2 -- unboxed call site -nested-let-loop.rkt 57:28 cdr -- pair -nested-let-loop.rkt 57:21 loop2 -- call to fun with unboxed args -nested-let-loop.rkt 54:38 0.0+0.0i -- unboxed literal +nested-let-loop.rkt 49:38 r -- unbox float-complex +nested-let-loop.rkt 49:40 s -- unbox float-complex +nested-let-loop.rkt 49:36 + -- unboxed binary float complex +nested-let-loop.rkt 49:35 (#%app + r s) -- unboxed float complex +nested-let-loop.rkt 42:8 r -- unboxed var -> table +nested-let-loop.rkt 40:6 loop1 -- unboxed function -> table +nested-let-loop.rkt 40:6 loop1 -- fun -> unboxed fun +nested-let-loop.rkt 44:10 r -- unboxed complex variable +nested-let-loop.rkt 49:38 r -- leave var unboxed +nested-let-loop.rkt 47:18 s -- unboxed var -> table +nested-let-loop.rkt 45:16 loop2 -- unboxed function -> table +nested-let-loop.rkt 45:16 loop2 -- fun -> unboxed fun +nested-let-loop.rkt 49:40 s -- leave var unboxed +nested-let-loop.rkt 49:21 loop1 -- unboxed call site +nested-let-loop.rkt 49:28 cdr -- pair +nested-let-loop.rkt 49:21 loop1 -- call to fun with unboxed args +nested-let-loop.rkt 50:38 s -- leave var unboxed +nested-let-loop.rkt 50:40 (#%app car x) -- unbox float-complex +nested-let-loop.rkt 50:41 car -- pair +nested-let-loop.rkt 50:48 (#%app car y) -- unbox float-complex +nested-let-loop.rkt 50:49 car -- pair +nested-let-loop.rkt 50:36 + -- unboxed binary float complex +nested-let-loop.rkt 50:21 loop2 -- unboxed call site +nested-let-loop.rkt 50:28 cdr -- pair +nested-let-loop.rkt 50:21 loop2 -- call to fun with unboxed args +nested-let-loop.rkt 47:38 0.0+0.0i -- unboxed literal #f (no location) (letrec-values (((loop2) (lambda (y s) (if (#%app null? y) (#%app loop1 (#%app cdr x) (#%app + r s)) (#%app loop2 (#%app cdr y) (#%app + s (#%app car x) (#%app car y))))))) loop2) -- unboxed call site -nested-let-loop.rkt 52:16 loop2 -- unboxed let loop -nested-let-loop.rkt 49:28 0.0+0.0i -- unboxed literal +nested-let-loop.rkt 45:16 loop2 -- unboxed let loop +nested-let-loop.rkt 42:28 0.0+0.0i -- unboxed literal #f (no location) (letrec-values (((loop1) (lambda (x r) (if (#%app null? x) r (#%app (letrec-values (((loop2) (lambda (y s) (if (#%app null? y) (#%app loop1 (#%app cdr x) (#%app + r s)) (#%app loop2 (#%app cdr y) (#%app + s (#%app car x) (#%app car y))))))) loop2) (quote (3.0+6.0i 4.0+8.0i)) (quote 0.0+0.0i)))))) loop1) -- unboxed call site -nested-let-loop.rkt 47:6 loop1 -- unboxed let loop +nested-let-loop.rkt 40:6 loop1 -- unboxed let loop 20.0+40.0i ) #lang typed/scheme #:optimize - - (let: loop1 : Float-Complex ((x : (Listof Float-Complex) '(1.0+2.0i 2.0+4.0i)) (r : Float-Complex 0.0+0.0i)) diff --git a/collects/tests/typed-scheme/optimizer/tests/nested-unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/tests/nested-unboxed-let.rkt index 1cce5db8..8d1ade59 100644 --- a/collects/tests/typed-scheme/optimizer/tests/nested-unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/nested-unboxed-let.rkt @@ -1,33 +1,26 @@ #; ( -nested-unboxed-let.rkt 32:14 x -- unbox float-complex -nested-unboxed-let.rkt 32:16 2.0+3.0i -- unboxed literal -nested-unboxed-let.rkt 32:12 + -- unboxed binary float complex -nested-unboxed-let.rkt 32:11 (#%app + x (quote 2.0+3.0i)) -- unboxed float complex -nested-unboxed-let.rkt 31:12 1.0+2.0i -- unboxed literal -nested-unboxed-let.rkt 31:21 2.0+3.0i -- unboxed literal -nested-unboxed-let.rkt 31:10 + -- unboxed binary float complex -nested-unboxed-let.rkt 31:0 (let-values (((x) (#%app + (quote 1.0+2.0i) (quote 2.0+3.0i)))) (let-values (((x) (#%app + x (quote 2.0+3.0i)))) (#%app + x (quote 3.0+6.0i)))) -- unboxed let bindings -nested-unboxed-let.rkt 33:7 x -- unbox float-complex -nested-unboxed-let.rkt 33:9 3.0+6.0i -- unboxed literal -nested-unboxed-let.rkt 33:5 + -- unboxed binary float complex -nested-unboxed-let.rkt 33:4 (#%app + x (quote 3.0+6.0i)) -- unboxed float complex -nested-unboxed-let.rkt 32:14 x -- leave var unboxed -nested-unboxed-let.rkt 32:16 2.0+3.0i -- unboxed literal -nested-unboxed-let.rkt 32:12 + -- unboxed binary float complex -nested-unboxed-let.rkt 32:2 (let-values (((x) (#%app + x (quote 2.0+3.0i)))) (#%app + x (quote 3.0+6.0i))) -- unboxed let bindings -nested-unboxed-let.rkt 33:7 x -- leave var unboxed -nested-unboxed-let.rkt 33:9 3.0+6.0i -- unboxed literal -nested-unboxed-let.rkt 33:5 + -- unboxed binary float complex -nested-unboxed-let.rkt 33:4 (#%app + x (quote 3.0+6.0i)) -- unboxed float complex +nested-unboxed-let.rkt 25:14 x -- unbox float-complex +nested-unboxed-let.rkt 25:16 2.0+3.0i -- unboxed literal +nested-unboxed-let.rkt 25:12 + -- unboxed binary float complex +nested-unboxed-let.rkt 25:11 (#%app + x (quote 2.0+3.0i)) -- unboxed float complex +nested-unboxed-let.rkt 24:12 1.0+2.0i -- unboxed literal +nested-unboxed-let.rkt 24:21 2.0+3.0i -- unboxed literal +nested-unboxed-let.rkt 24:10 + -- unboxed binary float complex +nested-unboxed-let.rkt 24:0 (let-values (((x) (#%app + (quote 1.0+2.0i) (quote 2.0+3.0i)))) (let-values (((x) (#%app + x (quote 2.0+3.0i)))) (#%app + x (quote 3.0+6.0i)))) -- unboxed let bindings +nested-unboxed-let.rkt 26:7 x -- unbox float-complex +nested-unboxed-let.rkt 26:9 3.0+6.0i -- unboxed literal +nested-unboxed-let.rkt 26:5 + -- unboxed binary float complex +nested-unboxed-let.rkt 26:4 (#%app + x (quote 3.0+6.0i)) -- unboxed float complex +nested-unboxed-let.rkt 25:14 x -- leave var unboxed +nested-unboxed-let.rkt 25:2 (let-values (((x) (#%app + x (quote 2.0+3.0i)))) (#%app + x (quote 3.0+6.0i))) -- unboxed let bindings +nested-unboxed-let.rkt 26:7 x -- leave var unboxed 8.0+14.0i ) #lang typed/scheme #:optimize - - (let ((x (+ 1.0+2.0i 2.0+3.0i))) (let ((x (+ x 2.0+3.0i))) (+ x 3.0+6.0i))) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt index 5cf7ea28..a9325e1f 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt @@ -1,44 +1,26 @@ #; ( #f (no location) make-sequence -- in-list -unboxed-for.rkt 53:9 i -- unbox float-complex -unboxed-for.rkt 53:11 sum -- unbox float-complex -unboxed-for.rkt 53:7 + -- unboxed binary float complex -unboxed-for.rkt 53:6 (#%app + i sum) -- unboxed float complex -unboxed-for.rkt 53:9 i -- unbox float-complex -unboxed-for.rkt 53:11 sum -- unbox float-complex -unboxed-for.rkt 53:7 + -- unboxed binary float complex -unboxed-for.rkt 53:6 (#%app + i sum) -- unboxed float complex -unboxed-for.rkt 51:31 sum -- unboxed var -> table +unboxed-for.rkt 33:9 i -- unbox float-complex +unboxed-for.rkt 33:11 sum -- unbox float-complex +unboxed-for.rkt 33:7 + -- unboxed binary float complex +unboxed-for.rkt 33:6 (#%app + i sum) -- unboxed float complex +unboxed-for.rkt 31:31 sum -- unboxed var -> table #f (no location) for-loop -- unboxed function -> table #f (no location) for-loop -- fun -> unboxed fun -unboxed-for.rkt 51:31 sum -- unboxed complex variable -unboxed-for.rkt 53:9 i -- unbox float-complex -unboxed-for.rkt 53:11 sum -- unbox float-complex -unboxed-for.rkt 53:7 + -- unboxed binary float complex -unboxed-for.rkt 53:6 (#%app + i sum) -- unboxed float complex +unboxed-for.rkt 31:31 sum -- unboxed complex variable #f (no location) (#%app pos->vals pos) -- unbox float-complex #f (no location) (let-values (((i) (#%app pos->vals pos))) (if (#%expression (if val-cont? (#%app val-cont? i) (quote #t))) (let-values (((sum) (let-values (((sum) sum)) (let-values () (#%app + i sum))))) (if (#%expression (if all-cont? (#%app all-cont? pos i) (quote #t))) (#%app for-loop sum (#%app pos-next pos)) sum)) sum)) -- unboxed let bindings -unboxed-for.rkt 52:13 i -- unboxed complex variable -unboxed-for.rkt 52:13 i -- unboxed complex variable -unboxed-for.rkt 53:9 i -- leave var unboxed -unboxed-for.rkt 53:11 sum -- unbox float-complex -unboxed-for.rkt 53:7 + -- unboxed binary float complex -unboxed-for.rkt 53:6 (#%app + i sum) -- unboxed float complex -unboxed-for.rkt 51:31 sum -- leave var unboxed +unboxed-for.rkt 32:13 i -- unboxed complex variable +unboxed-for.rkt 33:9 i -- leave var unboxed +unboxed-for.rkt 31:31 sum -- leave var unboxed #f (no location) (let-values (((sum) sum)) (let-values () (#%app + i sum))) -- unboxed let bindings -unboxed-for.rkt 53:9 i -- leave var unboxed -unboxed-for.rkt 53:11 sum -- leave var unboxed -unboxed-for.rkt 53:7 + -- unboxed binary float complex -unboxed-for.rkt 53:6 (#%app + i sum) -- unboxed float complex -unboxed-for.rkt 52:13 i -- unboxed complex variable -unboxed-for.rkt 51:31 sum -- unbox float-complex +unboxed-for.rkt 33:11 sum -- leave var unboxed +unboxed-for.rkt 31:31 sum -- unbox float-complex #f (no location) for-loop -- unboxed call site #f (no location) for-loop -- call to fun with unboxed args -unboxed-for.rkt 51:31 sum -- unboxed complex variable -unboxed-for.rkt 51:31 sum -- unboxed complex variable -unboxed-for.rkt 51:53 0.0+0.0i -- unboxed literal -unboxed-for.rkt 51:0 (letrec-values (((for-loop) (lambda (sum pos) (if (#%expression (if pos-cont? (#%app pos-cont? pos) (quote #t))) (let-values (((i) (#%app pos->vals pos))) (if (#%expression (if val-cont? (#%app val-cont? i) (quote #t))) (let-values (((sum) (let-values (((sum) sum)) (let-values () (#%app + i sum))))) (if (#%expression (if all-cont? (#%app all-cont? pos i) (quote #t))) (#%app for-loop sum (#%app pos-next pos)) sum)) sum)) sum)))) for-loop) -- unboxed call site +unboxed-for.rkt 31:53 0.0+0.0i -- unboxed literal +unboxed-for.rkt 31:0 (letrec-values (((for-loop) (lambda (sum pos) (if (#%expression (if pos-cont? (#%app pos-cont? pos) (quote #t))) (let-values (((i) (#%app pos->vals pos))) (if (#%expression (if val-cont? (#%app val-cont? i) (quote #t))) (let-values (((sum) (let-values (((sum) sum)) (let-values () (#%app + i sum))))) (if (#%expression (if all-cont? (#%app all-cont? pos i) (quote #t))) (#%app for-loop sum (#%app pos-next pos)) sum)) sum)) sum)))) for-loop) -- unboxed call site #f (no location) for-loop -- unboxed let loop 3.0+6.0i ) @@ -46,8 +28,6 @@ unboxed-for.rkt 51:0 (letrec-values (((for-loop) (lambda (sum pos) (if (#%expres #lang typed/scheme #:optimize - - (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex '(1.0+2.0i 2.0+4.0i))) (+ i sum)) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions1.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions1.rkt index d70bb4f0..d7854d18 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions1.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions1.rkt @@ -1,29 +1,24 @@ #; ( -unboxed-let-functions1.rkt 28:45 x -- unbox float-complex -unboxed-let-functions1.rkt 28:47 3.0+6.0i -- unboxed literal -unboxed-let-functions1.rkt 28:43 + -- unboxed binary float complex -unboxed-let-functions1.rkt 28:42 (#%app + x (quote 3.0+6.0i)) -- unboxed float complex -unboxed-let-functions1.rkt 28:20 x -- unboxed var -> table -unboxed-let-functions1.rkt 28:7 f -- unboxed function -> table -unboxed-let-functions1.rkt 28:7 f -- fun -> unboxed fun -unboxed-let-functions1.rkt 28:45 x -- leave var unboxed -unboxed-let-functions1.rkt 28:47 3.0+6.0i -- unboxed literal -unboxed-let-functions1.rkt 28:43 + -- unboxed binary float complex -unboxed-let-functions1.rkt 28:42 (#%app + x (quote 3.0+6.0i)) -- unboxed float complex -unboxed-let-functions1.rkt 29:8 1.0+2.0i -- unboxed literal -unboxed-let-functions1.rkt 29:17 2.0+4.0i -- unboxed literal -unboxed-let-functions1.rkt 29:6 + -- unboxed binary float complex -unboxed-let-functions1.rkt 29:3 f -- unboxed call site -unboxed-let-functions1.rkt 29:3 f -- call to fun with unboxed args +unboxed-let-functions1.rkt 23:45 x -- unbox float-complex +unboxed-let-functions1.rkt 23:47 3.0+6.0i -- unboxed literal +unboxed-let-functions1.rkt 23:43 + -- unboxed binary float complex +unboxed-let-functions1.rkt 23:42 (#%app + x (quote 3.0+6.0i)) -- unboxed float complex +unboxed-let-functions1.rkt 23:20 x -- unboxed var -> table +unboxed-let-functions1.rkt 23:7 f -- unboxed function -> table +unboxed-let-functions1.rkt 23:7 f -- fun -> unboxed fun +unboxed-let-functions1.rkt 23:45 x -- leave var unboxed +unboxed-let-functions1.rkt 24:8 1.0+2.0i -- unboxed literal +unboxed-let-functions1.rkt 24:17 2.0+4.0i -- unboxed literal +unboxed-let-functions1.rkt 24:6 + -- unboxed binary float complex +unboxed-let-functions1.rkt 24:3 f -- unboxed call site +unboxed-let-functions1.rkt 24:3 f -- call to fun with unboxed args 6.0+12.0i ) #lang typed/scheme #:optimize - - ;; simple case, function with single complex arg (let ((f (lambda: ((x : Float-Complex)) (+ x 3.0+6.0i)))) (f (+ 1.0+2.0i 2.0+4.0i))) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions2.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions2.rkt index e4938788..feaf2d33 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions2.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions2.rkt @@ -1,35 +1,27 @@ #; ( -unboxed-let-functions2.rkt 35:21 x -- unbox float-complex -unboxed-let-functions2.rkt 35:23 y -- unbox float-complex -unboxed-let-functions2.rkt 35:19 + -- unboxed binary float complex -unboxed-let-functions2.rkt 35:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions2.rkt 34:20 x -- unboxed var -> table -unboxed-let-functions2.rkt 35:21 x -- unbox float-complex -unboxed-let-functions2.rkt 35:23 y -- unbox float-complex -unboxed-let-functions2.rkt 35:19 + -- unboxed binary float complex -unboxed-let-functions2.rkt 35:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions2.rkt 34:42 y -- unboxed var -> table -unboxed-let-functions2.rkt 34:7 f -- unboxed function -> table -unboxed-let-functions2.rkt 34:7 f -- fun -> unboxed fun -unboxed-let-functions2.rkt 35:21 x -- leave var unboxed -unboxed-let-functions2.rkt 35:23 y -- leave var unboxed -unboxed-let-functions2.rkt 35:19 + -- unboxed binary float complex -unboxed-let-functions2.rkt 35:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions2.rkt 36:8 1.0+2.0i -- unboxed literal -unboxed-let-functions2.rkt 36:17 2.0+4.0i -- unboxed literal -unboxed-let-functions2.rkt 36:6 + -- unboxed binary float complex -unboxed-let-functions2.rkt 37:5 3.0+6.0i -- unboxed literal -unboxed-let-functions2.rkt 36:3 f -- unboxed call site -unboxed-let-functions2.rkt 36:3 f -- call to fun with unboxed args +unboxed-let-functions2.rkt 27:21 x -- unbox float-complex +unboxed-let-functions2.rkt 27:23 y -- unbox float-complex +unboxed-let-functions2.rkt 27:19 + -- unboxed binary float complex +unboxed-let-functions2.rkt 27:18 (#%app + x y) -- unboxed float complex +unboxed-let-functions2.rkt 26:20 x -- unboxed var -> table +unboxed-let-functions2.rkt 26:42 y -- unboxed var -> table +unboxed-let-functions2.rkt 26:7 f -- unboxed function -> table +unboxed-let-functions2.rkt 26:7 f -- fun -> unboxed fun +unboxed-let-functions2.rkt 27:21 x -- leave var unboxed +unboxed-let-functions2.rkt 27:23 y -- leave var unboxed +unboxed-let-functions2.rkt 28:8 1.0+2.0i -- unboxed literal +unboxed-let-functions2.rkt 28:17 2.0+4.0i -- unboxed literal +unboxed-let-functions2.rkt 28:6 + -- unboxed binary float complex +unboxed-let-functions2.rkt 29:5 3.0+6.0i -- unboxed literal +unboxed-let-functions2.rkt 28:3 f -- unboxed call site +unboxed-let-functions2.rkt 28:3 f -- call to fun with unboxed args 6.0+12.0i ) #lang typed/scheme #:optimize - - ;; function with multiple complex args (let ((f (lambda: ((x : Float-Complex) (y : Float-Complex)) (+ x y)))) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions3.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions3.rkt index 0980468d..a2ad5fe0 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions3.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions3.rkt @@ -1,29 +1,24 @@ #; ( -unboxed-let-functions3.rkt 29:21 x -- unbox float-complex -unboxed-let-functions3.rkt 29:23 y -- float-coerce-expr in complex ops -unboxed-let-functions3.rkt 29:19 + -- unboxed binary float complex -unboxed-let-functions3.rkt 29:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions3.rkt 28:20 x -- unboxed var -> table -unboxed-let-functions3.rkt 28:7 f -- unboxed function -> table -unboxed-let-functions3.rkt 28:7 f -- fun -> unboxed fun -unboxed-let-functions3.rkt 29:21 x -- leave var unboxed -unboxed-let-functions3.rkt 29:23 y -- float-coerce-expr in complex ops -unboxed-let-functions3.rkt 29:19 + -- unboxed binary float complex -unboxed-let-functions3.rkt 29:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions3.rkt 30:8 1.0+2.0i -- unboxed literal -unboxed-let-functions3.rkt 30:17 2.0+4.0i -- unboxed literal -unboxed-let-functions3.rkt 30:6 + -- unboxed binary float complex -unboxed-let-functions3.rkt 30:3 f -- unboxed call site -unboxed-let-functions3.rkt 30:3 f -- call to fun with unboxed args +unboxed-let-functions3.rkt 24:21 x -- unbox float-complex +unboxed-let-functions3.rkt 24:23 y -- float-coerce-expr in complex ops +unboxed-let-functions3.rkt 24:19 + -- unboxed binary float complex +unboxed-let-functions3.rkt 24:18 (#%app + x y) -- unboxed float complex +unboxed-let-functions3.rkt 23:20 x -- unboxed var -> table +unboxed-let-functions3.rkt 23:7 f -- unboxed function -> table +unboxed-let-functions3.rkt 23:7 f -- fun -> unboxed fun +unboxed-let-functions3.rkt 24:21 x -- leave var unboxed +unboxed-let-functions3.rkt 25:8 1.0+2.0i -- unboxed literal +unboxed-let-functions3.rkt 25:17 2.0+4.0i -- unboxed literal +unboxed-let-functions3.rkt 25:6 + -- unboxed binary float complex +unboxed-let-functions3.rkt 25:3 f -- unboxed call site +unboxed-let-functions3.rkt 25:3 f -- call to fun with unboxed args 6.0+6.0i ) #lang typed/scheme #:optimize - - ;; function with a mix of complex and non-complex args (let ((f (lambda: ((x : Float-Complex) (y : Float)) (+ x y)))) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions4.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions4.rkt index 9f36ff38..814f1d98 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions4.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions4.rkt @@ -1,29 +1,24 @@ #; ( -unboxed-let-functions4.rkt 29:21 x -- unbox float-complex -unboxed-let-functions4.rkt 29:23 y -- float-coerce-expr in complex ops -unboxed-let-functions4.rkt 29:19 + -- unboxed binary float complex -unboxed-let-functions4.rkt 29:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions4.rkt 28:32 x -- unboxed var -> table -unboxed-let-functions4.rkt 28:7 f -- unboxed function -> table -unboxed-let-functions4.rkt 28:7 f -- fun -> unboxed fun -unboxed-let-functions4.rkt 29:21 x -- leave var unboxed -unboxed-let-functions4.rkt 29:23 y -- float-coerce-expr in complex ops -unboxed-let-functions4.rkt 29:19 + -- unboxed binary float complex -unboxed-let-functions4.rkt 29:18 (#%app + x y) -- unboxed float complex -unboxed-let-functions4.rkt 31:8 1.0+2.0i -- unboxed literal -unboxed-let-functions4.rkt 31:17 2.0+4.0i -- unboxed literal -unboxed-let-functions4.rkt 31:6 + -- unboxed binary float complex -unboxed-let-functions4.rkt 30:3 f -- unboxed call site -unboxed-let-functions4.rkt 30:3 f -- call to fun with unboxed args +unboxed-let-functions4.rkt 24:21 x -- unbox float-complex +unboxed-let-functions4.rkt 24:23 y -- float-coerce-expr in complex ops +unboxed-let-functions4.rkt 24:19 + -- unboxed binary float complex +unboxed-let-functions4.rkt 24:18 (#%app + x y) -- unboxed float complex +unboxed-let-functions4.rkt 23:32 x -- unboxed var -> table +unboxed-let-functions4.rkt 23:7 f -- unboxed function -> table +unboxed-let-functions4.rkt 23:7 f -- fun -> unboxed fun +unboxed-let-functions4.rkt 24:21 x -- leave var unboxed +unboxed-let-functions4.rkt 26:8 1.0+2.0i -- unboxed literal +unboxed-let-functions4.rkt 26:17 2.0+4.0i -- unboxed literal +unboxed-let-functions4.rkt 26:6 + -- unboxed binary float complex +unboxed-let-functions4.rkt 25:3 f -- unboxed call site +unboxed-let-functions4.rkt 25:3 f -- call to fun with unboxed args 6.0+6.0i ) #lang typed/scheme #:optimize - - ;; function with a mix of complex and non-complex args, non-complex first (let ((f (lambda: ((y : Float) (x : Float-Complex)) (+ x y)))) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions6.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions6.rkt index 9d8b003f..cfd33002 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions6.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions6.rkt @@ -1,34 +1,29 @@ #; ( -unboxed-let-functions6.rkt 35:13 z -- unbox float-complex -unboxed-let-functions6.rkt 35:15 0.0+1.0i -- unboxed literal -unboxed-let-functions6.rkt 35:11 + -- unboxed binary float complex -unboxed-let-functions6.rkt 35:10 (#%app + z (quote 0.0+1.0i)) -- unboxed float complex -unboxed-let-functions6.rkt 32:31 z -- unboxed var -> table -unboxed-let-functions6.rkt 32:6 loop -- unboxed function -> table -unboxed-let-functions6.rkt 32:6 loop -- fun -> unboxed fun -unboxed-let-functions6.rkt 35:13 z -- leave var unboxed -unboxed-let-functions6.rkt 35:15 0.0+1.0i -- unboxed literal -unboxed-let-functions6.rkt 35:11 + -- unboxed binary float complex -unboxed-let-functions6.rkt 35:10 (#%app + z (quote 0.0+1.0i)) -- unboxed float complex -unboxed-let-functions6.rkt 36:19 z -- leave var unboxed -unboxed-let-functions6.rkt 36:22 car -- pair -unboxed-let-functions6.rkt 36:21 (#%app car l) -- float-coerce-expr in complex ops -unboxed-let-functions6.rkt 36:17 + -- unboxed binary float complex -unboxed-let-functions6.rkt 36:11 loop -- unboxed call site -unboxed-let-functions6.rkt 37:17 cdr -- pair -unboxed-let-functions6.rkt 36:11 loop -- call to fun with unboxed args -unboxed-let-functions6.rkt 32:51 0.0+0.0i -- unboxed literal +unboxed-let-functions6.rkt 30:13 z -- unbox float-complex +unboxed-let-functions6.rkt 30:15 0.0+1.0i -- unboxed literal +unboxed-let-functions6.rkt 30:11 + -- unboxed binary float complex +unboxed-let-functions6.rkt 30:10 (#%app + z (quote 0.0+1.0i)) -- unboxed float complex +unboxed-let-functions6.rkt 27:31 z -- unboxed var -> table +unboxed-let-functions6.rkt 27:6 loop -- unboxed function -> table +unboxed-let-functions6.rkt 27:6 loop -- fun -> unboxed fun +unboxed-let-functions6.rkt 30:13 z -- leave var unboxed +unboxed-let-functions6.rkt 31:19 z -- leave var unboxed +unboxed-let-functions6.rkt 31:22 car -- pair +unboxed-let-functions6.rkt 31:21 (#%app car l) -- float-coerce-expr in complex ops +unboxed-let-functions6.rkt 31:17 + -- unboxed binary float complex +unboxed-let-functions6.rkt 31:11 loop -- unboxed call site +unboxed-let-functions6.rkt 32:17 cdr -- pair +unboxed-let-functions6.rkt 31:11 loop -- call to fun with unboxed args +unboxed-let-functions6.rkt 27:51 0.0+0.0i -- unboxed literal #f (no location) (letrec-values (((loop) (lambda (z l) (if (#%app null? l) (#%app + z (quote 0.0+1.0i)) (#%app loop (#%app + z (#%app car l)) (#%app cdr l)))))) loop) -- unboxed call site -unboxed-let-functions6.rkt 32:6 loop -- unboxed let loop +unboxed-let-functions6.rkt 27:6 loop -- unboxed let loop 6.0+1.0i ) #lang typed/scheme #:optimize - - (let: loop : Float-Complex ((z : Float-Complex 0.0+0.0i) (l : (Listof Integer) '(1 2 3))) (if (null? l) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions7.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions7.rkt index 03fa119e..e93d0dc7 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions7.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let-functions7.rkt @@ -1,24 +1,21 @@ #; ( -unboxed-let-functions7.rkt 34:15 z -- unbox float-complex -unboxed-let-functions7.rkt 34:18 car -- pair -unboxed-let-functions7.rkt 34:17 (#%app car l) -- float-coerce-expr in complex ops -unboxed-let-functions7.rkt 34:13 + -- unboxed binary float complex -unboxed-let-functions7.rkt 34:12 (#%app + z (#%app car l)) -- unboxed float complex -unboxed-let-functions7.rkt 30:31 z -- unboxed var -> table -unboxed-let-functions7.rkt 30:6 loop -- unboxed function -> table -unboxed-let-functions7.rkt 30:6 loop -- fun -> unboxed fun -unboxed-let-functions7.rkt 33:6 z -- unboxed complex variable -unboxed-let-functions7.rkt 34:15 z -- leave var unboxed -unboxed-let-functions7.rkt 34:18 car -- pair -unboxed-let-functions7.rkt 34:17 (#%app car l) -- float-coerce-expr in complex ops -unboxed-let-functions7.rkt 34:13 + -- unboxed binary float complex -unboxed-let-functions7.rkt 34:7 loop -- unboxed call site -unboxed-let-functions7.rkt 35:13 cdr -- pair -unboxed-let-functions7.rkt 34:7 loop -- call to fun with unboxed args -unboxed-let-functions7.rkt 30:51 0.0+0.0i -- unboxed literal +unboxed-let-functions7.rkt 30:15 z -- unbox float-complex +unboxed-let-functions7.rkt 30:18 car -- pair +unboxed-let-functions7.rkt 30:17 (#%app car l) -- float-coerce-expr in complex ops +unboxed-let-functions7.rkt 30:13 + -- unboxed binary float complex +unboxed-let-functions7.rkt 30:12 (#%app + z (#%app car l)) -- unboxed float complex +unboxed-let-functions7.rkt 26:31 z -- unboxed var -> table +unboxed-let-functions7.rkt 26:6 loop -- unboxed function -> table +unboxed-let-functions7.rkt 26:6 loop -- fun -> unboxed fun +unboxed-let-functions7.rkt 29:6 z -- unboxed complex variable +unboxed-let-functions7.rkt 30:15 z -- leave var unboxed +unboxed-let-functions7.rkt 30:7 loop -- unboxed call site +unboxed-let-functions7.rkt 31:13 cdr -- pair +unboxed-let-functions7.rkt 30:7 loop -- call to fun with unboxed args +unboxed-let-functions7.rkt 26:51 0.0+0.0i -- unboxed literal #f (no location) (letrec-values (((loop) (lambda (z l) (if (#%app null? l) z (#%app loop (#%app + z (#%app car l)) (#%app cdr l)))))) loop) -- unboxed call site -unboxed-let-functions7.rkt 30:6 loop -- unboxed let loop +unboxed-let-functions7.rkt 26:6 loop -- unboxed let loop 6.0+0.0i ) @@ -26,7 +23,6 @@ unboxed-let-functions7.rkt 30:6 loop -- unboxed let loop #:optimize - (let: loop : Float-Complex ((z : Float-Complex 0.0+0.0i) (l : (Listof Integer) '(1 2 3))) (if (null? l) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt index d0e2ea38..bf05b1fe 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt @@ -1,31 +1,23 @@ #; ( -unboxed-let.rkt 38:14 t1 -- unbox float-complex -unboxed-let.rkt 38:17 3.0+6.0i -- unboxed literal -unboxed-let.rkt 38:12 - -- unboxed binary float complex -unboxed-let.rkt 38:11 (#%app - t1 (quote 3.0+6.0i)) -- unboxed float complex -unboxed-let.rkt 37:14 1.0+2.0i -- unboxed literal -unboxed-let.rkt 37:23 2.0+4.0i -- unboxed literal -unboxed-let.rkt 37:12 + -- unboxed binary float complex -unboxed-let.rkt 37:0 (let-values (((t1) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)))) (let-values (((t2) (#%app - t1 (quote 3.0+6.0i)))) (let-values (((t3) (quote 4.0+8.0i))) (#%app + t2 t3)))) -- unboxed let bindings -unboxed-let.rkt 40:5 t2 -- unbox float-complex -unboxed-let.rkt 40:8 t3 -- unbox float-complex -unboxed-let.rkt 40:3 + -- unboxed binary float complex -unboxed-let.rkt 40:2 (#%app + t2 t3) -- unboxed float complex -unboxed-let.rkt 38:14 t1 -- leave var unboxed -unboxed-let.rkt 38:17 3.0+6.0i -- unboxed literal -unboxed-let.rkt 38:12 - -- unboxed binary float complex -unboxed-let.rkt 37:0 (let-values (((t2) (#%app - t1 (quote 3.0+6.0i)))) (let-values (((t3) (quote 4.0+8.0i))) (#%app + t2 t3))) -- unboxed let bindings -unboxed-let.rkt 40:5 t2 -- leave var unboxed -unboxed-let.rkt 40:8 t3 -- unbox float-complex -unboxed-let.rkt 40:3 + -- unboxed binary float complex -unboxed-let.rkt 40:2 (#%app + t2 t3) -- unboxed float complex -unboxed-let.rkt 39:11 4.0+8.0i -- unboxed literal -unboxed-let.rkt 37:0 (let-values (((t3) (quote 4.0+8.0i))) (#%app + t2 t3)) -- unboxed let bindings -unboxed-let.rkt 40:5 t2 -- leave var unboxed -unboxed-let.rkt 40:8 t3 -- leave var unboxed -unboxed-let.rkt 40:3 + -- unboxed binary float complex -unboxed-let.rkt 40:2 (#%app + t2 t3) -- unboxed float complex +unboxed-let.rkt 30:14 t1 -- unbox float-complex +unboxed-let.rkt 30:17 3.0+6.0i -- unboxed literal +unboxed-let.rkt 30:12 - -- unboxed binary float complex +unboxed-let.rkt 30:11 (#%app - t1 (quote 3.0+6.0i)) -- unboxed float complex +unboxed-let.rkt 29:14 1.0+2.0i -- unboxed literal +unboxed-let.rkt 29:23 2.0+4.0i -- unboxed literal +unboxed-let.rkt 29:12 + -- unboxed binary float complex +unboxed-let.rkt 29:0 (let-values (((t1) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)))) (let-values (((t2) (#%app - t1 (quote 3.0+6.0i)))) (let-values (((t3) (quote 4.0+8.0i))) (#%app + t2 t3)))) -- unboxed let bindings +unboxed-let.rkt 32:5 t2 -- unbox float-complex +unboxed-let.rkt 32:8 t3 -- unbox float-complex +unboxed-let.rkt 32:3 + -- unboxed binary float complex +unboxed-let.rkt 32:2 (#%app + t2 t3) -- unboxed float complex +unboxed-let.rkt 30:14 t1 -- leave var unboxed +unboxed-let.rkt 29:0 (let-values (((t2) (#%app - t1 (quote 3.0+6.0i)))) (let-values (((t3) (quote 4.0+8.0i))) (#%app + t2 t3))) -- unboxed let bindings +unboxed-let.rkt 32:5 t2 -- leave var unboxed +unboxed-let.rkt 31:11 4.0+8.0i -- unboxed literal +unboxed-let.rkt 29:0 (let-values (((t3) (quote 4.0+8.0i))) (#%app + t2 t3)) -- unboxed let bindings +unboxed-let.rkt 32:8 t3 -- leave var unboxed 4.0+8.0i ) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let2.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let2.rkt index 162123d0..ef3a19c7 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let2.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let2.rkt @@ -1,32 +1,24 @@ #; ( -unboxed-let2.rkt 32:5 t1 -- unbox float-complex -unboxed-let2.rkt 32:8 t2 -- unbox float-complex -unboxed-let2.rkt 32:3 + -- unboxed binary float complex -unboxed-let2.rkt 32:2 (#%app + t1 t2) -- unboxed float complex -unboxed-let2.rkt 32:5 t1 -- unbox float-complex -unboxed-let2.rkt 32:8 t2 -- unbox float-complex -unboxed-let2.rkt 32:3 + -- unboxed binary float complex -unboxed-let2.rkt 32:2 (#%app + t1 t2) -- unboxed float complex -unboxed-let2.rkt 30:13 1.0+2.0i -- unboxed literal -unboxed-let2.rkt 30:22 2.0+4.0i -- unboxed literal -unboxed-let2.rkt 30:11 + -- unboxed binary float complex -unboxed-let2.rkt 31:13 3.0+6.0i -- unboxed literal -unboxed-let2.rkt 31:22 4.0+8.0i -- unboxed literal -unboxed-let2.rkt 31:11 + -- unboxed binary float complex -unboxed-let2.rkt 30:0 (let-values (((t1) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i))) ((t2) (#%app + (quote 3.0+6.0i) (quote 4.0+8.0i)))) (#%app + t1 t2)) -- unboxed let bindings -unboxed-let2.rkt 32:5 t1 -- leave var unboxed -unboxed-let2.rkt 32:8 t2 -- leave var unboxed -unboxed-let2.rkt 32:3 + -- unboxed binary float complex -unboxed-let2.rkt 32:2 (#%app + t1 t2) -- unboxed float complex +unboxed-let2.rkt 24:5 t1 -- unbox float-complex +unboxed-let2.rkt 24:8 t2 -- unbox float-complex +unboxed-let2.rkt 24:3 + -- unboxed binary float complex +unboxed-let2.rkt 24:2 (#%app + t1 t2) -- unboxed float complex +unboxed-let2.rkt 22:13 1.0+2.0i -- unboxed literal +unboxed-let2.rkt 22:22 2.0+4.0i -- unboxed literal +unboxed-let2.rkt 22:11 + -- unboxed binary float complex +unboxed-let2.rkt 23:13 3.0+6.0i -- unboxed literal +unboxed-let2.rkt 23:22 4.0+8.0i -- unboxed literal +unboxed-let2.rkt 23:11 + -- unboxed binary float complex +unboxed-let2.rkt 22:0 (let-values (((t1) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i))) ((t2) (#%app + (quote 3.0+6.0i) (quote 4.0+8.0i)))) (#%app + t1 t2)) -- unboxed let bindings +unboxed-let2.rkt 24:5 t1 -- leave var unboxed +unboxed-let2.rkt 24:8 t2 -- leave var unboxed 10.0+20.0i ) #lang typed/scheme #:optimize - - (let ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (+ 3.0+6.0i 4.0+8.0i))) (+ t1 t2)) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let3.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let3.rkt index a107c146..56361dfb 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let3.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let3.rkt @@ -1,26 +1,21 @@ #; ( -unboxed-let3.rkt 34:9 x -- unbox float-complex -unboxed-let3.rkt 34:11 2.0+4.0i -- unboxed literal -unboxed-let3.rkt 34:7 + -- unboxed binary float complex -unboxed-let3.rkt 34:6 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex -unboxed-let3.rkt 31:12 1.0+2.0i -- unboxed literal -unboxed-let3.rkt 31:21 2.0+4.0i -- unboxed literal -unboxed-let3.rkt 31:10 + -- unboxed binary float complex -unboxed-let3.rkt 31:0 (let-values (((x) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)))) (if (#%app even? (quote 2)) x (#%app + x (quote 2.0+4.0i)))) -- unboxed let bindings -unboxed-let3.rkt 33:6 x -- unboxed complex variable -unboxed-let3.rkt 34:9 x -- leave var unboxed -unboxed-let3.rkt 34:11 2.0+4.0i -- unboxed literal -unboxed-let3.rkt 34:7 + -- unboxed binary float complex -unboxed-let3.rkt 34:6 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-let3.rkt 29:9 x -- unbox float-complex +unboxed-let3.rkt 29:11 2.0+4.0i -- unboxed literal +unboxed-let3.rkt 29:7 + -- unboxed binary float complex +unboxed-let3.rkt 29:6 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-let3.rkt 26:12 1.0+2.0i -- unboxed literal +unboxed-let3.rkt 26:21 2.0+4.0i -- unboxed literal +unboxed-let3.rkt 26:10 + -- unboxed binary float complex +unboxed-let3.rkt 26:0 (let-values (((x) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)))) (if (#%app even? (quote 2)) x (#%app + x (quote 2.0+4.0i)))) -- unboxed let bindings +unboxed-let3.rkt 28:6 x -- unboxed complex variable +unboxed-let3.rkt 29:9 x -- leave var unboxed 3.0+6.0i ) #lang typed/scheme #:optimize - - ;; both boxed and unboxed uses, we unbox anyway ;; causes unnecessary boxing/unboxing if we take a boxed path when ;; unboxing a complex literal or variable, but I expect this case diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec-syntaxes+values.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec-syntaxes+values.rkt index 2519447e..9ac15167 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec-syntaxes+values.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec-syntaxes+values.rkt @@ -1,25 +1,20 @@ #; ( -unboxed-letrec-syntaxes+values.rkt 25:27 x -- unbox float-complex -unboxed-letrec-syntaxes+values.rkt 25:29 2.0+4.0i -- unboxed literal -unboxed-letrec-syntaxes+values.rkt 25:25 + -- unboxed binary float complex -unboxed-letrec-syntaxes+values.rkt 25:24 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex -unboxed-letrec-syntaxes+values.rkt 24:33 1.0+2.0i -- unboxed literal -unboxed-letrec-syntaxes+values.rkt 24:42 2.0+4.0i -- unboxed literal -unboxed-letrec-syntaxes+values.rkt 24:31 + -- unboxed binary float complex -unboxed-letrec-syntaxes+values.rkt 23:0 (letrec-syntaxes+values (((s) (syntax-rules () ((_ x) x)))) (((x) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)))) (#%app + x (quote 2.0+4.0i))) -- unboxed let bindings -unboxed-letrec-syntaxes+values.rkt 25:27 x -- leave var unboxed -unboxed-letrec-syntaxes+values.rkt 25:29 2.0+4.0i -- unboxed literal -unboxed-letrec-syntaxes+values.rkt 25:25 + -- unboxed binary float complex -unboxed-letrec-syntaxes+values.rkt 25:24 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-letrec-syntaxes+values.rkt 20:27 x -- unbox float-complex +unboxed-letrec-syntaxes+values.rkt 20:29 2.0+4.0i -- unboxed literal +unboxed-letrec-syntaxes+values.rkt 20:25 + -- unboxed binary float complex +unboxed-letrec-syntaxes+values.rkt 20:24 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-letrec-syntaxes+values.rkt 19:33 1.0+2.0i -- unboxed literal +unboxed-letrec-syntaxes+values.rkt 19:42 2.0+4.0i -- unboxed literal +unboxed-letrec-syntaxes+values.rkt 19:31 + -- unboxed binary float complex +unboxed-letrec-syntaxes+values.rkt 18:0 (letrec-syntaxes+values (((s) (syntax-rules () ((_ x) x)))) (((x) (#%app + (quote 1.0+2.0i) (quote 2.0+4.0i)))) (#%app + x (quote 2.0+4.0i))) -- unboxed let bindings +unboxed-letrec-syntaxes+values.rkt 20:27 x -- leave var unboxed 5.0+10.0i ) #lang typed/scheme #:optimize - - (letrec-syntaxes+values (((s) (syntax-rules () [(_ x) x]))) (((x) (+ 1.0+2.0i 2.0+4.0i))) (+ x 2.0+4.0i)) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec.rkt index 2641c3c9..9c71b92f 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-letrec.rkt @@ -1,22 +1,16 @@ #; ( -unboxed-letrec.rkt 31:5 x -- unbox float-complex -unboxed-letrec.rkt 31:7 y -- unbox float-complex -unboxed-letrec.rkt 31:3 + -- unboxed binary float complex -unboxed-letrec.rkt 31:2 (#%app + x y) -- unboxed float complex -unboxed-letrec.rkt 31:5 x -- unbox float-complex -unboxed-letrec.rkt 31:7 y -- unbox float-complex -unboxed-letrec.rkt 31:3 + -- unboxed binary float complex -unboxed-letrec.rkt 31:2 (#%app + x y) -- unboxed float complex -unboxed-letrec.rkt 29:31 1.0+2.0i -- unboxed literal -unboxed-letrec.rkt 30:34 2.0+4.0i -- unboxed literal -unboxed-letrec.rkt 30:43 3.0+6.0i -- unboxed literal -unboxed-letrec.rkt 30:32 + -- unboxed binary float complex -unboxed-letrec.rkt 28:0 (letrec-values (((f) (lambda (x) (#%app f x))) ((x) (quote 1.0+2.0i)) ((y) (#%app + (quote 2.0+4.0i) (quote 3.0+6.0i)))) (#%app + x y)) -- unboxed let bindings -unboxed-letrec.rkt 31:5 x -- leave var unboxed -unboxed-letrec.rkt 31:7 y -- leave var unboxed -unboxed-letrec.rkt 31:3 + -- unboxed binary float complex -unboxed-letrec.rkt 31:2 (#%app + x y) -- unboxed float complex +unboxed-letrec.rkt 25:5 x -- unbox float-complex +unboxed-letrec.rkt 25:7 y -- unbox float-complex +unboxed-letrec.rkt 25:3 + -- unboxed binary float complex +unboxed-letrec.rkt 25:2 (#%app + x y) -- unboxed float complex +unboxed-letrec.rkt 23:31 1.0+2.0i -- unboxed literal +unboxed-letrec.rkt 24:34 2.0+4.0i -- unboxed literal +unboxed-letrec.rkt 24:43 3.0+6.0i -- unboxed literal +unboxed-letrec.rkt 24:32 + -- unboxed binary float complex +unboxed-letrec.rkt 22:0 (letrec-values (((f) (lambda (x) (#%app f x))) ((x) (quote 1.0+2.0i)) ((y) (#%app + (quote 2.0+4.0i) (quote 3.0+6.0i)))) (#%app + x y)) -- unboxed let bindings +unboxed-letrec.rkt 25:5 x -- leave var unboxed +unboxed-letrec.rkt 25:7 y -- leave var unboxed 6.0+12.0i ) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-make-rectangular.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-make-rectangular.rkt index 988a669d..83f35bfe 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-make-rectangular.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-make-rectangular.rkt @@ -1,25 +1,19 @@ #; ( -unboxed-make-rectangular.rkt 33:5 x -- unbox float-complex -unboxed-make-rectangular.rkt 33:7 2.0+4.0i -- unboxed literal -unboxed-make-rectangular.rkt 33:3 + -- unboxed binary float complex -unboxed-make-rectangular.rkt 33:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex -unboxed-make-rectangular.rkt 32:10 make-rectangular -- make-rectangular elimination -unboxed-make-rectangular.rkt 32:0 (let-values (((x) (#%app make-rectangular (quote 1.0) (quote 2.0)))) (#%app + x (quote 2.0+4.0i))) -- unboxed let bindings -unboxed-make-rectangular.rkt 33:5 x -- leave var unboxed -unboxed-make-rectangular.rkt 33:7 2.0+4.0i -- unboxed literal -unboxed-make-rectangular.rkt 33:3 + -- unboxed binary float complex -unboxed-make-rectangular.rkt 33:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex -unboxed-make-rectangular.rkt 35:5 x -- unbox float-complex -unboxed-make-rectangular.rkt 35:7 2.0+4.0i -- unboxed literal -unboxed-make-rectangular.rkt 35:3 + -- unboxed binary float complex -unboxed-make-rectangular.rkt 35:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex -unboxed-make-rectangular.rkt 34:10 unsafe-make-flrectangular -- make-rectangular elimination -unboxed-make-rectangular.rkt 34:0 (let-values (((x) (#%app unsafe-make-flrectangular (quote 1.0) (quote 2.0)))) (#%app + x (quote 2.0+4.0i))) -- unboxed let bindings -unboxed-make-rectangular.rkt 35:5 x -- leave var unboxed -unboxed-make-rectangular.rkt 35:7 2.0+4.0i -- unboxed literal -unboxed-make-rectangular.rkt 35:3 + -- unboxed binary float complex -unboxed-make-rectangular.rkt 35:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-make-rectangular.rkt 28:5 x -- unbox float-complex +unboxed-make-rectangular.rkt 28:7 2.0+4.0i -- unboxed literal +unboxed-make-rectangular.rkt 28:3 + -- unboxed binary float complex +unboxed-make-rectangular.rkt 28:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-make-rectangular.rkt 27:10 make-rectangular -- make-rectangular elimination +unboxed-make-rectangular.rkt 27:0 (let-values (((x) (#%app make-rectangular (quote 1.0) (quote 2.0)))) (#%app + x (quote 2.0+4.0i))) -- unboxed let bindings +unboxed-make-rectangular.rkt 28:5 x -- leave var unboxed +unboxed-make-rectangular.rkt 30:5 x -- unbox float-complex +unboxed-make-rectangular.rkt 30:7 2.0+4.0i -- unboxed literal +unboxed-make-rectangular.rkt 30:3 + -- unboxed binary float complex +unboxed-make-rectangular.rkt 30:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float complex +unboxed-make-rectangular.rkt 29:10 unsafe-make-flrectangular -- make-rectangular elimination +unboxed-make-rectangular.rkt 29:0 (let-values (((x) (#%app unsafe-make-flrectangular (quote 1.0) (quote 2.0)))) (#%app + x (quote 2.0+4.0i))) -- unboxed let bindings +unboxed-make-rectangular.rkt 30:5 x -- leave var unboxed 3.0+6.0i 3.0+6.0i ) @@ -27,6 +21,7 @@ unboxed-make-rectangular.rkt 35:2 (#%app + x (quote 2.0+4.0i)) -- unboxed float #lang typed/scheme #:optimize + (require racket/unsafe/ops) (let ((x (make-rectangular 1.0 2.0))) diff --git a/collects/typed-scheme/optimizer/utils.rkt b/collects/typed-scheme/optimizer/utils.rkt index 0996bd0b..0e8ea75f 100644 --- a/collects/typed-scheme/optimizer/utils.rkt +++ b/collects/typed-scheme/optimizer/utils.rkt @@ -1,6 +1,6 @@ #lang scheme/base -(require unstable/match racket/match +(require unstable/match racket/match racket/set racket/dict syntax/id-table racket/syntax unstable/syntax "../utils/utils.rkt" (for-template scheme/base) @@ -29,12 +29,19 @@ (format "~a:~a" line col) "(no location)"))) +;; we keep track of log entries, to avoid repetitions that would be +;; caused by traversing the same syntax multiple times (which is not +;; a problem per se) +(define log-so-far (set)) (define (do-logging msg stx) - (printf "~a ~a ~a -- ~a\n" - (syntax-source-file-name stx) - (line+col->string stx) - (syntax->datum stx) - msg)) + (let ([new-message (format "~a ~a ~a -- ~a\n" + (syntax-source-file-name stx) + (line+col->string stx) + (syntax->datum stx) + msg)]) + (unless (set-member? log-so-far new-message) + (set! log-so-far (set-add log-so-far new-message)) + (display new-message)))) (define *log-optimizations?* (in-command-line? "--log-optimizations")) (define (log-optimization kind stx)