diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/all-real.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/all-real.rkt index b2528577..35398a96 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/all-real.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/all-real.rkt @@ -1,10 +1,10 @@ #; ( TR missed opt: all-real.rkt 24:0 (+ (ann 3 Real) (ann 4 Real)) -- all args float-arg-expr, result not Float -- caused by: 24:8 3, 24:21 4 +TR info: all-real.rkt 24:0 (+ (ann 3 Real) (ann 4 Real)) -- exact real arith TR missed opt: all-real.rkt 25:0 (* (ann 3 Real) (ann 4 Real)) -- all args float-arg-expr, result not Float -- caused by: 25:8 3, 25:21 4 -7 -12 -) +TR info: all-real.rkt 25:0 (* (ann 3 Real) (ann 4 Real)) -- exact real arith +7 12) #lang typed/racket diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file1.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file1.rkt index e8060758..f00ed4cc 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file1.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file1.rkt @@ -1,10 +1,10 @@ #; ( TR missed opt: multi-file1.rkt 12:2 (* x (ann 3 Integer)) -- all args float-arg-expr, result not Float -- caused by: 12:12 3 +TR info: multi-file1.rkt 12:2 (* x (ann 3 Integer)) -- exact real arith ) #lang typed/racket - (provide f) (: f : Float -> Real) diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file2.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file2.rkt index 637b2d20..257f6893 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file2.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/multi-file2.rkt @@ -1,13 +1,13 @@ #; ( TR missed opt: multi-file1.rkt 12:2 (* x (ann 3 Integer)) -- all args float-arg-expr, result not Float -- caused by: 12:12 3 +TR info: multi-file1.rkt 12:2 (* x (ann 3 Integer)) -- exact real arith TR opt: multi-file2.rkt 13:10 (+ 3 5) -- fixnum bounded expr TR opt: multi-file2.rkt 13:3 (* 3.4 (+ 3 5)) -- binary float 81.6 ) #lang typed/racket - (require "multi-file1.rkt") (f (* 3.4 (+ 3 5))) diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/multiple-irritants.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/multiple-irritants.rkt index 9837e4e1..db8a1867 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/multiple-irritants.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/multiple-irritants.rkt @@ -1,8 +1,8 @@ #; ( TR missed opt: multiple-irritants.rkt 9:0 (* (ann 4 Integer) (ann 5 Integer) 6.0) -- all args float-arg-expr, result not Float -- caused by: 9:8 4, 9:24 5 -120.0 -) +TR info: multiple-irritants.rkt 9:0 (* (ann 4 Integer) (ann 5 Integer) 6.0) -- exact real arith +120.0) #lang typed/racket diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/nested-same-kind.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/nested-same-kind.rkt index 92c659c9..b2791caa 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/nested-same-kind.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/nested-same-kind.rkt @@ -1,32 +1,32 @@ #; ( TR missed opt: nested-same-kind.rkt 34:7 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 34:19 4 +TR info: nested-same-kind.rkt 34:7 (* 3.0 (ann 4 Integer)) -- exact real arith TR missed opt: nested-same-kind.rkt 34:0 (* 2.0 (* 3.0 (ann 4 Integer))) -- all args float-arg-expr, result not Float -- caused by: 34:7 (* 3.0 (ann 4 Integer)) -TR missed opt: nested-same-kind.rkt 34:7 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 34:19 4 +TR info: nested-same-kind.rkt 34:0 (* 2.0 (* 3.0 (ann 4 Integer))) -- exact real arith TR missed opt: nested-same-kind.rkt 35:14 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 35:26 4 +TR info: nested-same-kind.rkt 35:14 (* 3.0 (ann 4 Integer)) -- exact real arith TR missed opt: nested-same-kind.rkt 35:7 (* 2.0 (* 3.0 (ann 4 Integer))) -- all args float-arg-expr, result not Float -- caused by: 35:14 (* 3.0 (ann 4 Integer)) -TR missed opt: nested-same-kind.rkt 35:14 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 35:26 4 +TR info: nested-same-kind.rkt 35:7 (* 2.0 (* 3.0 (ann 4 Integer))) -- exact real arith TR missed opt: nested-same-kind.rkt 35:0 (* 1.0 (* 2.0 (* 3.0 (ann 4 Integer)))) -- all args float-arg-expr, result not Float -- caused by: 35:7 (* 2.0 (* 3.0 (ann 4 Integer))) -TR missed opt: nested-same-kind.rkt 35:14 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 35:26 4 -TR missed opt: nested-same-kind.rkt 35:7 (* 2.0 (* 3.0 (ann 4 Integer))) -- all args float-arg-expr, result not Float -- caused by: 35:14 (* 3.0 (ann 4 Integer)) -TR missed opt: nested-same-kind.rkt 35:14 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 35:26 4 +TR info: nested-same-kind.rkt 35:0 (* 1.0 (* 2.0 (* 3.0 (ann 4 Integer)))) -- exact real arith TR missed opt: nested-same-kind.rkt 36:7 (* 3.0 (ann 4 Integer) (ann 5 Integer)) -- all args float-arg-expr, result not Float -- caused by: 36:19 4, 36:35 5 +TR info: nested-same-kind.rkt 36:7 (* 3.0 (ann 4 Integer) (ann 5 Integer)) -- exact real arith TR missed opt: nested-same-kind.rkt 36:0 (* 2.0 (* 3.0 (ann 4 Integer) (ann 5 Integer))) -- all args float-arg-expr, result not Float -- caused by: 36:7 (* 3.0 (ann 4 Integer) (ann 5 Integer)) -TR missed opt: nested-same-kind.rkt 36:7 (* 3.0 (ann 4 Integer) (ann 5 Integer)) -- all args float-arg-expr, result not Float -- caused by: 36:19 4, 36:35 5 +TR info: nested-same-kind.rkt 36:0 (* 2.0 (* 3.0 (ann 4 Integer) (ann 5 Integer))) -- exact real arith TR missed opt: nested-same-kind.rkt 37:3 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 37:15 4 +TR info: nested-same-kind.rkt 37:3 (* 3.0 (ann 4 Integer)) -- exact real arith TR missed opt: nested-same-kind.rkt 37:27 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 37:39 4 +TR info: nested-same-kind.rkt 37:27 (* 3.0 (ann 4 Integer)) -- exact real arith TR missed opt: nested-same-kind.rkt 37:0 (* (* 3.0 (ann 4 Integer)) (* 3.0 (ann 4 Integer))) -- all args float-arg-expr, result not Float -- caused by: 37:3 (* 3.0 (ann 4 Integer)), 37:27 (* 3.0 (ann 4 Integer)) -TR missed opt: nested-same-kind.rkt 37:3 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 37:15 4 -TR missed opt: nested-same-kind.rkt 37:27 (* 3.0 (ann 4 Integer)) -- all args float-arg-expr, result not Float -- caused by: 37:39 4 +TR info: nested-same-kind.rkt 37:0 (* (* 3.0 (ann 4 Integer)) (* 3.0 (ann 4 Integer))) -- exact real arith 24.0 24.0 120.0 144.0 ) - #lang typed/racket - ;; when a single "bubble" causes missed optimizations to cascade, a single ;; close call should be reported, with the outermost expression being reported ;; but with the innermost flagged as the cause diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/precision-loss.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/precision-loss.rkt index dd17daf9..5d02a359 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/precision-loss.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/precision-loss.rkt @@ -1,22 +1,24 @@ #; ( +TR info: precision-loss.rkt 36:3 (* 3/4 2/3) -- exact real arith TR missed opt: precision-loss.rkt 36:0 (+ (* 3/4 2/3) 2.0) -- exact ops inside float expr -- caused by: 36:3 (* 3/4 2/3) TR opt: precision-loss.rkt 36:0 (+ (* 3/4 2/3) 2.0) -- binary float TR opt: precision-loss.rkt 38:0 (+ 3/4 2.0) -- binary float +TR info: precision-loss.rkt 40:3 (- 3/4) -- exact real arith TR missed opt: precision-loss.rkt 40:0 (+ (- 3/4) 2.0) -- exact ops inside float expr -- caused by: 40:3 (- 3/4) TR opt: precision-loss.rkt 40:0 (+ (- 3/4) 2.0) -- binary float +TR info: precision-loss.rkt 42:39 (+ 1/4 3/4) -- exact real arith TR missed opt: precision-loss.rkt 42:0 (+ (vector-ref (quote #(2/3 1/2 3/4)) (assert (+ 1/4 3/4) exact-integer?)) 2.0) -- all args float-arg-expr, result not Float -- caused by: 42:3 (vector-ref (quote #(2/3 1/2 3/4)) (assert (+ 1/4 3/4) exact-integer?)) +TR info: precision-loss.rkt 42:39 (+ 1/4 3/4) -- exact real arith TR missed opt: precision-loss.rkt 48:8 (* 3/4 2/3) -- all args float-arg-expr, result not Float -- caused by: 48:11 3/4, 48:15 2/3 +TR info: precision-loss.rkt 48:8 (* 3/4 2/3) -- exact real arith TR opt: precision-loss.rkt 49:3 (car (list (* 2.0 (ann (* 3/4 2/3) Real)))) -- pair TR missed opt: precision-loss.rkt 49:26 (* 3/4 2/3) -- all args float-arg-expr, result not Float -- caused by: 49:29 3/4, 49:33 2/3 +TR info: precision-loss.rkt 49:26 (* 3/4 2/3) -- exact real arith TR missed opt: precision-loss.rkt 49:14 (* 2.0 (ann (* 3/4 2/3) Real)) -- all args float-arg-expr, result not Float -- caused by: 49:26 (* 3/4 2/3) -TR missed opt: precision-loss.rkt 49:26 (* 3/4 2/3) -- all args float-arg-expr, result not Float -- caused by: 49:29 3/4, 49:33 2/3 +TR info: precision-loss.rkt 49:14 (* 2.0 (ann (* 3/4 2/3) Real)) -- exact real arith TR missed opt: precision-loss.rkt 48:0 (* (ann (* 3/4 2/3) Real) (car (list (* 2.0 (ann (* 3/4 2/3) Real)))) 2.0) -- all args float-arg-expr, result not Float -- caused by: 48:8 (* 3/4 2/3), 49:3 (car (list (* 2.0 (ann (* 3/4 2/3) Real)))) -TR missed opt: precision-loss.rkt 48:8 (* 3/4 2/3) -- all args float-arg-expr, result not Float -- caused by: 48:11 3/4, 48:15 2/3 -TR opt: precision-loss.rkt 49:3 (car (list (* 2.0 (ann (* 3/4 2/3) Real)))) -- pair -TR missed opt: precision-loss.rkt 49:26 (* 3/4 2/3) -- all args float-arg-expr, result not Float -- caused by: 49:29 3/4, 49:33 2/3 -TR missed opt: precision-loss.rkt 49:14 (* 2.0 (ann (* 3/4 2/3) Real)) -- all args float-arg-expr, result not Float -- caused by: 49:26 (* 3/4 2/3) -TR missed opt: precision-loss.rkt 49:26 (* 3/4 2/3) -- all args float-arg-expr, result not Float -- caused by: 49:29 3/4, 49:33 2/3 +TR info: precision-loss.rkt 48:0 (* (ann (* 3/4 2/3) Real) (car (list (* 2.0 (ann (* 3/4 2/3) Real)))) 2.0) -- exact real arith 2.5 2.75 1.25 @@ -26,8 +28,6 @@ TR missed opt: precision-loss.rkt 49:26 (* 3/4 2/3) -- all args float-arg-expr, - - #lang typed/racket ;; warn when the extra precision gained by doing exact computations would diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/real-in-float-expr.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/real-in-float-expr.rkt index 10f56aca..eaeaa5a3 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/real-in-float-expr.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/real-in-float-expr.rkt @@ -1,13 +1,13 @@ #; ( TR missed opt: real-in-float-expr.rkt 17:0 (* (ann 3 Real) 2.3) -- all args float-arg-expr, result not Float -- caused by: 17:8 3 +TR info: real-in-float-expr.rkt 17:0 (* (ann 3 Real) 2.3) -- exact real arith TR opt: real-in-float-expr.rkt 22:0 (* 2 3) -- fixnum bounded expr TR opt: real-in-float-expr.rkt 23:0 (+ 2 3) -- fixnum bounded expr +TR info: real-in-float-expr.rkt 24:0 (+ 2/3 3/4) -- exact real arith TR missed opt: real-in-float-expr.rkt 26:0 (* (ann 2 Natural) 2.0) -- all args float-arg-expr, result not Float -- caused by: 26:8 2 -6.8999999999999995 -6 -5 -6 +TR info: real-in-float-expr.rkt 26:0 (* (ann 2 Natural) 2.0) -- exact real arith +6.8999999999999995 6 5 6 5 17/12 4.0 diff --git a/collects/tests/typed-racket/optimizer/missed-optimizations/unary-float.rkt b/collects/tests/typed-racket/optimizer/missed-optimizations/unary-float.rkt index 19e44c8d..1bee7d6d 100644 --- a/collects/tests/typed-racket/optimizer/missed-optimizations/unary-float.rkt +++ b/collects/tests/typed-racket/optimizer/missed-optimizations/unary-float.rkt @@ -1,12 +1,12 @@ #; ( TR missed opt: unary-float.rkt 14:0 (sin (ann 3.4 Real)) -- all args float-arg-expr, result not Float -- caused by: 14:10 3.4 +TR info: unary-float.rkt 14:0 (sin (ann 3.4 Real)) -- exact real arith TR missed opt: unary-float.rkt 15:0 (sin 3) -- all args float-arg-expr, result not Float -- caused by: 15:5 3 +TR info: unary-float.rkt 15:0 (sin 3) -- exact real arith TR missed opt: unary-float.rkt 16:0 (abs (ann 3.4 Real)) -- all args float-arg-expr, result not Float -- caused by: 16:10 3.4 --0.2555411020268312 -0.1411200080598672 -3.4 -3 +TR info: unary-float.rkt 16:0 (abs (ann 3.4 Real)) -- exact real arith +-0.2555411020268312 0.1411200080598672 3.4 3 ) #lang typed/racket diff --git a/collects/tests/typed-racket/optimizer/tests/bounds-check.rkt b/collects/tests/typed-racket/optimizer/tests/bounds-check.rkt index 94a76977..0e91f99a 100644 --- a/collects/tests/typed-racket/optimizer/tests/bounds-check.rkt +++ b/collects/tests/typed-racket/optimizer/tests/bounds-check.rkt @@ -4,17 +4,17 @@ TR opt: bounds-check.rkt 25:2 (vector-ref v i) -- vector partial bounds checking TR opt: bounds-check.rkt 28:2 (vector-set! v i n) -- vector partial bounds checking elimination TR opt: bounds-check.rkt 31:2 (vector-ref v i) -- vector partial bounds checking elimination TR opt: bounds-check.rkt 34:2 (vector-set! v i n) -- vector partial bounds checking elimination +TR info: bounds-check.rkt 37:1 displayln -- hidden parameter +TR info: bounds-check.rkt 39:1 displayln -- hidden parameter +TR info: bounds-check.rkt 41:1 displayln -- hidden parameter TR opt: bounds-check.rkt 46:2 (flvector-ref v i) -- flvector partial bounds checking elimination TR opt: bounds-check.rkt 49:2 (flvector-set! v i n) -- flvector partial bounds checking elimination TR opt: bounds-check.rkt 52:2 (flvector-ref v i) -- flvector partial bounds checking elimination TR opt: bounds-check.rkt 55:2 (flvector-set! v i n) -- flvector partial bounds checking elimination -3 -4 -5 -3.0 -4.0 -5.0 -) +TR info: bounds-check.rkt 58:1 displayln -- hidden parameter +TR info: bounds-check.rkt 60:1 displayln -- hidden parameter +TR info: bounds-check.rkt 62:1 displayln -- hidden parameter +3 4 5 3.0 4.0 5.0) #lang typed/racket diff --git a/collects/tests/typed-racket/optimizer/tests/case-arrow.rkt b/collects/tests/typed-racket/optimizer/tests/case-arrow.rkt index 2a8f0dc8..396774fb 100644 --- a/collects/tests/typed-racket/optimizer/tests/case-arrow.rkt +++ b/collects/tests/typed-racket/optimizer/tests/case-arrow.rkt @@ -1,20 +1,13 @@ #; ( TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min +TR info: case-arrow.rkt 41:15 (- max min) -- exact real arith TR missed opt: case-arrow.rkt 41:12 (* (- max min) x) -- all args float-arg-expr, result not Float -- caused by: 41:15 (- max min), 41:27 x -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min +TR info: case-arrow.rkt 41:12 (* (- max min) x) -- exact real arith TR missed opt: case-arrow.rkt 41:9 (/ (* (- max min) x) p) -- all args float-arg-expr, result not Float -- caused by: 41:12 (* (- max min) x), 41:30 p -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min -TR missed opt: case-arrow.rkt 41:12 (* (- max min) x) -- all args float-arg-expr, result not Float -- caused by: 41:15 (- max min), 41:27 x -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min +TR info: case-arrow.rkt 41:9 (/ (* (- max min) x) p) -- exact real arith TR missed opt: case-arrow.rkt 41:2 (+ min (/ (* (- max min) x) p)) -- all args float-arg-expr, result not Float -- caused by: 41:5 min, 41:9 (/ (* (- max min) x) p) -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min -TR missed opt: case-arrow.rkt 41:12 (* (- max min) x) -- all args float-arg-expr, result not Float -- caused by: 41:15 (- max min), 41:27 x -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min -TR missed opt: case-arrow.rkt 41:9 (/ (* (- max min) x) p) -- all args float-arg-expr, result not Float -- caused by: 41:12 (* (- max min) x), 41:30 p -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min -TR missed opt: case-arrow.rkt 41:12 (* (- max min) x) -- all args float-arg-expr, result not Float -- caused by: 41:15 (- max min), 41:27 x -TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, result not Float -- caused by: 41:18 max, 41:22 min +TR info: case-arrow.rkt 41:2 (+ min (/ (* (- max min) x) p)) -- exact real arith ) #lang typed/racket @@ -25,6 +18,13 @@ TR missed opt: case-arrow.rkt 41:15 (- max min) -- all args float-arg-expr, resu + + + + + + + ;; Typechecking functions with case-> types causes the body to be typechecked ;; multiple times, which is fine, except that it used to cause the type table ;; to only have information for the last branch (clobbering). This would cause diff --git a/collects/tests/typed-racket/optimizer/tests/dead-else.rkt b/collects/tests/typed-racket/optimizer/tests/dead-else.rkt index cb3f5eb0..de1de1d7 100644 --- a/collects/tests/typed-racket/optimizer/tests/dead-else.rkt +++ b/collects/tests/typed-racket/optimizer/tests/dead-else.rkt @@ -1,14 +1,14 @@ #; ( +TR info: dead-else.rkt 12:1 display -- hidden parameter TR opt: dead-else.rkt 14:13 (+ 4.0 5.0) -- dead else branch TR opt: dead-else.rkt 13:13 (+ 2.0 3.0) -- binary float +TR info: dead-else.rkt 15:1 display -- hidden parameter TR opt: dead-else.rkt 17:13 (+ 4.0 5.0) -- dead else branch TR opt: dead-else.rkt 16:13 (+ 2.0 3.0) -- binary float 5.05.0) - #lang typed/scheme #:optimize - (display (if (number? 3) (+ 2.0 3.0) (+ 4.0 5.0))) diff --git a/collects/tests/typed-racket/optimizer/tests/dead-substructs.rkt b/collects/tests/typed-racket/optimizer/tests/dead-substructs.rkt index 638a5cf0..8eab2ebf 100644 --- a/collects/tests/typed-racket/optimizer/tests/dead-substructs.rkt +++ b/collects/tests/typed-racket/optimizer/tests/dead-substructs.rkt @@ -1,8 +1,8 @@ #; ( -1 -2 -) +TR info: dead-substructs.rkt 23:4 make-child1 -- struct constructor +TR info: dead-substructs.rkt 24:4 make-child2 -- struct constructor +1 2) #lang typed/scheme #:optimize diff --git a/collects/tests/typed-racket/optimizer/tests/dead-then.rkt b/collects/tests/typed-racket/optimizer/tests/dead-then.rkt index 25f6ad58..c5c48481 100644 --- a/collects/tests/typed-racket/optimizer/tests/dead-then.rkt +++ b/collects/tests/typed-racket/optimizer/tests/dead-then.rkt @@ -1,14 +1,14 @@ #; ( +TR info: dead-then.rkt 12:1 display -- hidden parameter TR opt: dead-then.rkt 13:13 (+ 2.0 3.0) -- dead then branch TR opt: dead-then.rkt 14:13 (+ 4.0 5.0) -- binary float +TR info: dead-then.rkt 15:1 display -- hidden parameter TR opt: dead-then.rkt 16:13 (+ 2.0 3.0) -- dead then branch TR opt: dead-then.rkt 17:13 (+ 4.0 5.0) -- binary float 9.09.0) - #lang typed/scheme #:optimize - (display (if (number? "eh") (+ 2.0 3.0) (+ 4.0 5.0))) diff --git a/collects/tests/typed-racket/optimizer/tests/define-begin-float.rkt b/collects/tests/typed-racket/optimizer/tests/define-begin-float.rkt index 1159a1df..6ba13ce4 100644 --- a/collects/tests/typed-racket/optimizer/tests/define-begin-float.rkt +++ b/collects/tests/typed-racket/optimizer/tests/define-begin-float.rkt @@ -1,11 +1,11 @@ #; ( +TR info: define-begin-float.rkt 10:18 display -- hidden parameter TR opt: define-begin-float.rkt 10:26 (- 2.0 3.0) -- binary float TR opt: define-begin-float.rkt 11:17 (* 2.0 3.0) -- binary float -1.0) #lang typed/scheme #:optimize - (define a (begin (display (- 2.0 3.0)) (* 2.0 3.0))) diff --git a/collects/tests/typed-racket/optimizer/tests/different-langs.rkt b/collects/tests/typed-racket/optimizer/tests/different-langs.rkt index c6fe02b7..ecba7b26 100644 --- a/collects/tests/typed-racket/optimizer/tests/different-langs.rkt +++ b/collects/tests/typed-racket/optimizer/tests/different-langs.rkt @@ -1,7 +1,7 @@ #; ( -1/2 -) +TR info: different-langs.rkt 10:0 (/ 1 2) -- exact real arith +1/2) #lang typed/scheme #:optimize diff --git a/collects/tests/typed-racket/optimizer/tests/float-complex-sin.rkt b/collects/tests/typed-racket/optimizer/tests/float-complex-sin.rkt index 2f30ca5d..36eb2fa7 100644 --- a/collects/tests/typed-racket/optimizer/tests/float-complex-sin.rkt +++ b/collects/tests/typed-racket/optimizer/tests/float-complex-sin.rkt @@ -1,20 +1,23 @@ #; ( -TR missed opt: float-complex-sin.rkt 19:18 (* t 6.28) -- all args float-arg-expr, result not Float -- caused by: 19:21 t -TR missed opt: float-complex-sin.rkt 19:13 (sin (* t 6.28)) -- all args float-arg-expr, result not Float -- caused by: 19:18 (* t 6.28) -TR missed opt: float-complex-sin.rkt 19:18 (* t 6.28) -- all args float-arg-expr, result not Float -- caused by: 19:21 t -TR missed opt: float-complex-sin.rkt 19:18 (* t 6.28) -- all args float-arg-expr, result not Float -- caused by: 19:21 t -TR missed opt: float-complex-sin.rkt 19:13 (sin (* t 6.28)) -- all args float-arg-expr, result not Float -- caused by: 19:18 (* t 6.28) -TR missed opt: float-complex-sin.rkt 19:18 (* t 6.28) -- all args float-arg-expr, result not Float -- caused by: 19:21 t -TR opt: float-complex-sin.rkt 19:13 (sin (* t 6.28)) -- float-arg-expr in complex ops -TR opt: float-complex-sin.rkt 19:30 0.0+0.0i -- unboxed literal -TR opt: float-complex-sin.rkt 19:10 (+ (sin (* t 6.28)) 0.0+0.0i) -- unboxed binary float complex +TR missed opt: float-complex-sin.rkt 22:18 (* t 6.28) -- all args float-arg-expr, result not Float -- caused by: 22:21 t +TR info: float-complex-sin.rkt 22:18 (* t 6.28) -- exact real arith +TR missed opt: float-complex-sin.rkt 22:13 (sin (* t 6.28)) -- all args float-arg-expr, result not Float -- caused by: 22:18 (* t 6.28) +TR info: float-complex-sin.rkt 22:13 (sin (* t 6.28)) -- exact real arith +TR missed opt: float-complex-sin.rkt 22:18 (* t 6.28) -- all args float-arg-expr, result not Float -- caused by: 22:21 t +TR info: float-complex-sin.rkt 22:18 (* t 6.28) -- exact real arith +TR missed opt: float-complex-sin.rkt 22:13 (sin (* t 6.28)) -- all args float-arg-expr, result not Float -- caused by: 22:18 (* t 6.28) +TR info: float-complex-sin.rkt 22:13 (sin (* t 6.28)) -- exact real arith +TR opt: float-complex-sin.rkt 22:13 (sin (* t 6.28)) -- float-arg-expr in complex ops +TR opt: float-complex-sin.rkt 22:30 0.0+0.0i -- unboxed literal +TR opt: float-complex-sin.rkt 22:10 (+ (sin (* t 6.28)) 0.0+0.0i) -- unboxed binary float complex -0.0031853017931379904+0.0i ) + + #lang typed/scheme #:optimize - ((lambda: ((t : Integer)) (+ (sin (* t 6.28)) 0.0+0.0i)) 1) diff --git a/collects/tests/typed-racket/optimizer/tests/float-real.rkt b/collects/tests/typed-racket/optimizer/tests/float-real.rkt index b7de71ba..c2f38e70 100644 --- a/collects/tests/typed-racket/optimizer/tests/float-real.rkt +++ b/collects/tests/typed-racket/optimizer/tests/float-real.rkt @@ -2,18 +2,18 @@ ( TR opt: float-real.rkt 18:0 (+ 2.3 (ann 3 Positive-Real)) -- binary float TR missed opt: float-real.rkt 19:15 (* (ann 2 Integer) 3.2) -- all args float-arg-expr, result not Float -- caused by: 19:23 2 +TR info: float-real.rkt 19:15 (* (ann 2 Integer) 3.2) -- exact real arith TR opt: float-real.rkt 19:0 (+ 2.3 (assert (* (ann 2 Integer) 3.2) positive?)) -- binary float TR missed opt: float-real.rkt 20:7 (* (ann 2 Integer) 3.1) -- all args float-arg-expr, result not Float -- caused by: 20:15 2 +TR info: float-real.rkt 20:7 (* (ann 2 Integer) 3.1) -- exact real arith TR missed opt: float-real.rkt 20:0 (* 2.3 (* (ann 2 Integer) 3.1)) -- all args float-arg-expr, result not Float -- caused by: 20:7 (* (ann 2 Integer) 3.1) -TR missed opt: float-real.rkt 20:7 (* (ann 2 Integer) 3.1) -- all args float-arg-expr, result not Float -- caused by: 20:15 2 +TR info: float-real.rkt 20:0 (* 2.3 (* (ann 2 Integer) 3.1)) -- exact real arith 5.3 8.7 14.26 ) - #lang typed/racket - ;; reals within float expressions should be coerced when it's safe to do so (+ 2.3 (ann 3 Positive-Real)) ; safe (+ 2.3 (assert (* (ann 2 Integer) 3.2) positive?)) ; inner = unsafe, outer = unsafe diff --git a/collects/tests/typed-racket/optimizer/tests/in-bytes.rkt b/collects/tests/typed-racket/optimizer/tests/in-bytes.rkt index e9626bee..cd21b51b 100644 --- a/collects/tests/typed-racket/optimizer/tests/in-bytes.rkt +++ b/collects/tests/typed-racket/optimizer/tests/in-bytes.rkt @@ -1,10 +1,10 @@ #; ( -TR opt: in-bytes.rkt 6:0 #%module-begin -- in-bytes +TR opt: in-bytes.rkt 7:0 #%module-begin -- in-bytes +TR info: in-bytes.rkt 10:7 display -- hidden parameter +TR info: in-bytes.rkt 10:7 display -- hidden parameter 495051) - #lang typed/scheme #:optimize - (for: ((i : Integer #"123")) (display i)) diff --git a/collects/tests/typed-racket/optimizer/tests/in-list.rkt b/collects/tests/typed-racket/optimizer/tests/in-list.rkt index 0a3b1c84..7fe1eab1 100644 --- a/collects/tests/typed-racket/optimizer/tests/in-list.rkt +++ b/collects/tests/typed-racket/optimizer/tests/in-list.rkt @@ -1,10 +1,10 @@ #; ( -TR opt: in-list.rkt 6:0 #%module-begin -- in-list +TR opt: in-list.rkt 7:0 #%module-begin -- in-list +TR info: in-list.rkt 10:7 display -- hidden parameter +TR info: in-list.rkt 10:7 display -- hidden parameter 123) - #lang typed/scheme #:optimize - (for: ((i : Natural '(1 2 3))) (display i)) diff --git a/collects/tests/typed-racket/optimizer/tests/in-range.rkt b/collects/tests/typed-racket/optimizer/tests/in-range.rkt index d2965a38..b7bf4e5a 100644 --- a/collects/tests/typed-racket/optimizer/tests/in-range.rkt +++ b/collects/tests/typed-racket/optimizer/tests/in-range.rkt @@ -1,10 +1,10 @@ #; ( -TR opt: in-range.rkt 6:0 #%module-begin -- in-range +TR opt: in-range.rkt 7:0 #%module-begin -- in-range +TR info: in-range.rkt 10:3 display -- hidden parameter +TR info: in-range.rkt 10:3 display -- hidden parameter 0123) - #lang typed/scheme #:optimize - (for ([i 4]) (display i)) diff --git a/collects/tests/typed-racket/optimizer/tests/in-string.rkt b/collects/tests/typed-racket/optimizer/tests/in-string.rkt index 4acbbc15..a08e6f1f 100644 --- a/collects/tests/typed-racket/optimizer/tests/in-string.rkt +++ b/collects/tests/typed-racket/optimizer/tests/in-string.rkt @@ -1,10 +1,10 @@ #; ( -TR opt: in-string.rkt 6:0 #%module-begin -- in-string +TR opt: in-string.rkt 7:0 #%module-begin -- in-string +TR info: in-string.rkt 10:7 display -- hidden parameter +TR info: in-string.rkt 10:7 display -- hidden parameter 123) - #lang typed/scheme #:optimize - (for: ((i : Char "123")) (display i)) diff --git a/collects/tests/typed-racket/optimizer/tests/in-vector.rkt b/collects/tests/typed-racket/optimizer/tests/in-vector.rkt index 3c854281..7976ce6c 100644 --- a/collects/tests/typed-racket/optimizer/tests/in-vector.rkt +++ b/collects/tests/typed-racket/optimizer/tests/in-vector.rkt @@ -1,10 +1,10 @@ #; ( -TR opt: in-vector.rkt 6:0 #%module-begin -- in-vector +TR opt: in-vector.rkt 7:0 #%module-begin -- in-vector +TR info: in-vector.rkt 10:7 display -- hidden parameter +TR info: in-vector.rkt 10:7 display -- hidden parameter 123) - #lang typed/scheme #:optimize - (for: ((i : Integer (vector 1 2 3))) (display i)) diff --git a/collects/tests/typed-racket/optimizer/tests/invalid-binary-nonzero-fixnum.rkt b/collects/tests/typed-racket/optimizer/tests/invalid-binary-nonzero-fixnum.rkt index 896ebc8b..cbbd01a4 100644 --- a/collects/tests/typed-racket/optimizer/tests/invalid-binary-nonzero-fixnum.rkt +++ b/collects/tests/typed-racket/optimizer/tests/invalid-binary-nonzero-fixnum.rkt @@ -1,5 +1,6 @@ #; ( + TR info: invalid-binary-nonzero-fixnum.rkt 10:3 display -- hidden parameter ) #lang typed/scheme diff --git a/collects/tests/typed-racket/optimizer/tests/invalid-float-promotion.rkt b/collects/tests/typed-racket/optimizer/tests/invalid-float-promotion.rkt index 9fc1e8ab..6096c76b 100644 --- a/collects/tests/typed-racket/optimizer/tests/invalid-float-promotion.rkt +++ b/collects/tests/typed-racket/optimizer/tests/invalid-float-promotion.rkt @@ -1,11 +1,11 @@ #; ( TR missed opt: invalid-float-promotion.rkt 12:0 (/ (ann 1 Integer) 2.0) -- all args float-arg-expr, result not Float -- caused by: 12:8 1 +TR info: invalid-float-promotion.rkt 12:0 (/ (ann 1 Integer) 2.0) -- exact real arith TR missed opt: invalid-float-promotion.rkt 13:0 (* (ann 2/3 Exact-Rational) 3.0) -- all args float-arg-expr, result not Float -- caused by: 13:8 2/3 -0.5 -2.0 +TR info: invalid-float-promotion.rkt 13:0 (* (ann 2/3 Exact-Rational) 3.0) -- exact real arith +0.5 2.0 ) - #lang typed/scheme #:optimize ;; the ann are necessary, since (* PosReal Float) -> Float (exact 0 is not in PosReal) diff --git a/collects/tests/typed-racket/optimizer/tests/invalid-unboxed-let.rkt b/collects/tests/typed-racket/optimizer/tests/invalid-unboxed-let.rkt index 82ab482b..263fc14a 100644 --- a/collects/tests/typed-racket/optimizer/tests/invalid-unboxed-let.rkt +++ b/collects/tests/typed-racket/optimizer/tests/invalid-unboxed-let.rkt @@ -1,24 +1,28 @@ #; ( -TR opt: invalid-unboxed-let.rkt 31:14 t1 -- unbox float-complex -TR opt: invalid-unboxed-let.rkt 31:17 t1 -- unbox float-complex -TR opt: invalid-unboxed-let.rkt 31:11 (+ t1 t1) -- unboxed binary float complex -TR opt: invalid-unboxed-let.rkt 31:14 t1 -- unbox float-complex -TR opt: invalid-unboxed-let.rkt 31:17 t1 -- unbox float-complex -TR opt: invalid-unboxed-let.rkt 31:11 (+ t1 t1) -- unboxed binary float complex -TR opt: invalid-unboxed-let.rkt 31:14 t1 -- unbox float-complex -TR opt: invalid-unboxed-let.rkt 31:17 t1 -- unbox float-complex -TR opt: invalid-unboxed-let.rkt 31:11 (+ t1 t1) -- unboxed binary float complex -TR opt: invalid-unboxed-let.rkt 27:13 1.0+2.0i -- unboxed literal -TR opt: invalid-unboxed-let.rkt 27:22 2.0+4.0i -- unboxed literal -TR opt: invalid-unboxed-let.rkt 27:10 (+ 1.0+2.0i 2.0+4.0i) -- unboxed binary float complex -TR opt: invalid-unboxed-let.rkt 28:13 3.0+6.0i -- unboxed literal -TR opt: invalid-unboxed-let.rkt 28:22 4.0+8.0i -- unboxed literal -TR opt: invalid-unboxed-let.rkt 28:10 (+ 3.0+6.0i 4.0+8.0i) -- unboxed binary float complex -TR opt: invalid-unboxed-let.rkt 27:0 (let ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (+ 3.0+6.0i 4.0+8.0i)) (t3 1.0+2.0i) (t4 1)) (display (+ t1 t1)) (display t2) (display t3) (display t4)) -- unboxed let bindings -TR opt: invalid-unboxed-let.rkt 31:14 t1 -- leave var unboxed -TR opt: invalid-unboxed-let.rkt 31:17 t1 -- leave var unboxed -TR opt: invalid-unboxed-let.rkt 31:11 (+ t1 t1) -- unboxed binary float complex +TR opt: invalid-unboxed-let.rkt 35:14 t1 -- unbox float-complex +TR opt: invalid-unboxed-let.rkt 35:17 t1 -- unbox float-complex +TR opt: invalid-unboxed-let.rkt 35:11 (+ t1 t1) -- unboxed binary float complex +TR opt: invalid-unboxed-let.rkt 35:14 t1 -- unbox float-complex +TR opt: invalid-unboxed-let.rkt 35:17 t1 -- unbox float-complex +TR opt: invalid-unboxed-let.rkt 35:11 (+ t1 t1) -- unboxed binary float complex +TR opt: invalid-unboxed-let.rkt 35:14 t1 -- unbox float-complex +TR opt: invalid-unboxed-let.rkt 35:17 t1 -- unbox float-complex +TR opt: invalid-unboxed-let.rkt 35:11 (+ t1 t1) -- unboxed binary float complex +TR opt: invalid-unboxed-let.rkt 31:13 1.0+2.0i -- unboxed literal +TR opt: invalid-unboxed-let.rkt 31:22 2.0+4.0i -- unboxed literal +TR opt: invalid-unboxed-let.rkt 31:10 (+ 1.0+2.0i 2.0+4.0i) -- unboxed binary float complex +TR opt: invalid-unboxed-let.rkt 32:13 3.0+6.0i -- unboxed literal +TR opt: invalid-unboxed-let.rkt 32:22 4.0+8.0i -- unboxed literal +TR opt: invalid-unboxed-let.rkt 32:10 (+ 3.0+6.0i 4.0+8.0i) -- unboxed binary float complex +TR opt: invalid-unboxed-let.rkt 31:0 (let ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (+ 3.0+6.0i 4.0+8.0i)) (t3 1.0+2.0i) (t4 1)) (display (+ t1 t1)) (display t2) (display t3) (display t4)) -- unboxed let bindings +TR info: invalid-unboxed-let.rkt 35:3 display -- hidden parameter +TR opt: invalid-unboxed-let.rkt 35:14 t1 -- leave var unboxed +TR opt: invalid-unboxed-let.rkt 35:17 t1 -- leave var unboxed +TR opt: invalid-unboxed-let.rkt 35:11 (+ t1 t1) -- unboxed binary float complex +TR info: invalid-unboxed-let.rkt 36:3 display -- hidden parameter +TR info: invalid-unboxed-let.rkt 37:3 display -- hidden parameter +TR info: invalid-unboxed-let.rkt 38:3 display -- hidden parameter 6.0+12.0i7.0+14.0i1.0+2.0i1) #lang typed/scheme diff --git a/collects/tests/typed-racket/optimizer/tests/structs.rkt b/collects/tests/typed-racket/optimizer/tests/structs.rkt index 7b8d7704..cebe4301 100644 --- a/collects/tests/typed-racket/optimizer/tests/structs.rkt +++ b/collects/tests/typed-racket/optimizer/tests/structs.rkt @@ -1,5 +1,6 @@ #; ( +TR info: structs.rkt 12:11 pt -- struct constructor TR opt: structs.rkt 13:0 (pt-x a) -- struct ref TR opt: structs.rkt 14:0 (set-pt-y! a 5) -- struct set 3 @@ -7,7 +8,6 @@ TR opt: structs.rkt 14:0 (set-pt-y! a 5) -- struct set #lang typed/scheme #:optimize - (define-struct: pt ((x : Integer) (y : Integer)) #:mutable) (define a (pt 3 4)) (pt-x a)