diff --git a/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt b/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt index 056592a3..d3a25c88 100644 --- a/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/derived-pair.rkt @@ -1,13 +1,17 @@ #; ( -TR opt: derived-pair.rkt 19:0 (caar (cons (cons 1 2) 3)) -- derived pair -TR opt: derived-pair.rkt 19:0 (caar (cons (cons 1 2) 3)) -- pair -TR opt: derived-pair.rkt 20:0 (cadr (cons 1 (cons 2 3))) -- derived pair -TR opt: derived-pair.rkt 20:0 (cadr (cons 1 (cons 2 3))) -- pair -TR opt: derived-pair.rkt 21:0 (cdar (cons (cons 1 2) 3)) -- derived pair -TR opt: derived-pair.rkt 21:0 (cdar (cons (cons 1 2) 3)) -- pair -TR opt: derived-pair.rkt 22:0 (cddr (cons 1 (cons 2 3))) -- derived pair -TR opt: derived-pair.rkt 22:0 (cddr (cons 1 (cons 2 3))) -- pair +TR opt: derived-pair.rkt 23:0 (caar (cons (cons 1 2) 3)) -- derived pair +TR opt: derived-pair.rkt 23:0 (caar (cons (cons 1 2) 3)) -- pair +TR opt: derived-pair.rkt 23:0 (caar (cons (cons 1 2) 3)) -- pair +TR opt: derived-pair.rkt 24:0 (cadr (cons 1 (cons 2 3))) -- derived pair +TR opt: derived-pair.rkt 24:0 (cadr (cons 1 (cons 2 3))) -- pair +TR opt: derived-pair.rkt 24:0 (cadr (cons 1 (cons 2 3))) -- pair +TR opt: derived-pair.rkt 25:0 (cdar (cons (cons 1 2) 3)) -- derived pair +TR opt: derived-pair.rkt 25:0 (cdar (cons (cons 1 2) 3)) -- pair +TR opt: derived-pair.rkt 25:0 (cdar (cons (cons 1 2) 3)) -- pair +TR opt: derived-pair.rkt 26:0 (cddr (cons 1 (cons 2 3))) -- derived pair +TR opt: derived-pair.rkt 26:0 (cddr (cons 1 (cons 2 3))) -- pair +TR opt: derived-pair.rkt 26:0 (cddr (cons 1 (cons 2 3))) -- 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 095d5e84..c456d799 100644 --- a/collects/tests/typed-scheme/optimizer/tests/derived-pair2.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/derived-pair2.rkt @@ -1,21 +1,37 @@ #; ( -TR opt: derived-pair2.rkt 31:0 (caaar (cons (cons (cons 1 2) 3) 4)) -- derived pair -TR opt: derived-pair2.rkt 31:0 (caaar (cons (cons (cons 1 2) 3) 4)) -- pair -TR opt: derived-pair2.rkt 32:0 (caadr (cons 1 (cons (cons 2 3) 4))) -- derived pair -TR opt: derived-pair2.rkt 32:0 (caadr (cons 1 (cons (cons 2 3) 4))) -- pair -TR opt: derived-pair2.rkt 33:0 (cadar (cons (cons 1 (cons 2 3)) 4)) -- derived pair -TR opt: derived-pair2.rkt 33:0 (cadar (cons (cons 1 (cons 2 3)) 4)) -- pair -TR opt: derived-pair2.rkt 34:0 (caddr (cons 1 (cons 2 (cons 3 4)))) -- derived pair -TR opt: derived-pair2.rkt 34:0 (caddr (cons 1 (cons 2 (cons 3 4)))) -- pair -TR opt: derived-pair2.rkt 35:0 (cdaar (cons (cons (cons 1 2) 3) 4)) -- derived pair -TR opt: derived-pair2.rkt 35:0 (cdaar (cons (cons (cons 1 2) 3) 4)) -- pair -TR opt: derived-pair2.rkt 36:0 (cdadr (cons 1 (cons (cons 2 3) 4))) -- derived pair -TR opt: derived-pair2.rkt 36:0 (cdadr (cons 1 (cons (cons 2 3) 4))) -- pair -TR opt: derived-pair2.rkt 37:0 (cddar (cons (cons 1 (cons 2 3)) 4)) -- derived pair -TR opt: derived-pair2.rkt 37:0 (cddar (cons (cons 1 (cons 2 3)) 4)) -- pair -TR opt: derived-pair2.rkt 38:0 (cdddr (cons 1 (cons 2 (cons 3 4)))) -- derived pair -TR opt: derived-pair2.rkt 38:0 (cdddr (cons 1 (cons 2 (cons 3 4)))) -- pair +TR opt: derived-pair2.rkt 47:0 (caaar (cons (cons (cons 1 2) 3) 4)) -- derived pair +TR opt: derived-pair2.rkt 47:0 (caaar (cons (cons (cons 1 2) 3) 4)) -- pair +TR opt: derived-pair2.rkt 47:0 (caaar (cons (cons (cons 1 2) 3) 4)) -- pair +TR opt: derived-pair2.rkt 47:0 (caaar (cons (cons (cons 1 2) 3) 4)) -- pair +TR opt: derived-pair2.rkt 48:0 (caadr (cons 1 (cons (cons 2 3) 4))) -- derived pair +TR opt: derived-pair2.rkt 48:0 (caadr (cons 1 (cons (cons 2 3) 4))) -- pair +TR opt: derived-pair2.rkt 48:0 (caadr (cons 1 (cons (cons 2 3) 4))) -- pair +TR opt: derived-pair2.rkt 48:0 (caadr (cons 1 (cons (cons 2 3) 4))) -- pair +TR opt: derived-pair2.rkt 49:0 (cadar (cons (cons 1 (cons 2 3)) 4)) -- derived pair +TR opt: derived-pair2.rkt 49:0 (cadar (cons (cons 1 (cons 2 3)) 4)) -- pair +TR opt: derived-pair2.rkt 49:0 (cadar (cons (cons 1 (cons 2 3)) 4)) -- pair +TR opt: derived-pair2.rkt 49:0 (cadar (cons (cons 1 (cons 2 3)) 4)) -- pair +TR opt: derived-pair2.rkt 50:0 (caddr (cons 1 (cons 2 (cons 3 4)))) -- derived pair +TR opt: derived-pair2.rkt 50:0 (caddr (cons 1 (cons 2 (cons 3 4)))) -- pair +TR opt: derived-pair2.rkt 50:0 (caddr (cons 1 (cons 2 (cons 3 4)))) -- pair +TR opt: derived-pair2.rkt 50:0 (caddr (cons 1 (cons 2 (cons 3 4)))) -- pair +TR opt: derived-pair2.rkt 51:0 (cdaar (cons (cons (cons 1 2) 3) 4)) -- derived pair +TR opt: derived-pair2.rkt 51:0 (cdaar (cons (cons (cons 1 2) 3) 4)) -- pair +TR opt: derived-pair2.rkt 51:0 (cdaar (cons (cons (cons 1 2) 3) 4)) -- pair +TR opt: derived-pair2.rkt 51:0 (cdaar (cons (cons (cons 1 2) 3) 4)) -- pair +TR opt: derived-pair2.rkt 52:0 (cdadr (cons 1 (cons (cons 2 3) 4))) -- derived pair +TR opt: derived-pair2.rkt 52:0 (cdadr (cons 1 (cons (cons 2 3) 4))) -- pair +TR opt: derived-pair2.rkt 52:0 (cdadr (cons 1 (cons (cons 2 3) 4))) -- pair +TR opt: derived-pair2.rkt 52:0 (cdadr (cons 1 (cons (cons 2 3) 4))) -- pair +TR opt: derived-pair2.rkt 53:0 (cddar (cons (cons 1 (cons 2 3)) 4)) -- derived pair +TR opt: derived-pair2.rkt 53:0 (cddar (cons (cons 1 (cons 2 3)) 4)) -- pair +TR opt: derived-pair2.rkt 53:0 (cddar (cons (cons 1 (cons 2 3)) 4)) -- pair +TR opt: derived-pair2.rkt 53:0 (cddar (cons (cons 1 (cons 2 3)) 4)) -- pair +TR opt: derived-pair2.rkt 54:0 (cdddr (cons 1 (cons 2 (cons 3 4)))) -- derived pair +TR opt: derived-pair2.rkt 54:0 (cdddr (cons 1 (cons 2 (cons 3 4)))) -- pair +TR opt: derived-pair2.rkt 54:0 (cdddr (cons 1 (cons 2 (cons 3 4)))) -- pair +TR opt: derived-pair2.rkt 54:0 (cdddr (cons 1 (cons 2 (cons 3 4)))) -- 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 e470fbce..89d5adec 100644 --- a/collects/tests/typed-scheme/optimizer/tests/derived-pair3.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/derived-pair3.rkt @@ -1,37 +1,85 @@ #; ( -TR opt: derived-pair3.rkt 55:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- derived pair -TR opt: derived-pair3.rkt 55:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair -TR opt: derived-pair3.rkt 56:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- derived pair -TR opt: derived-pair3.rkt 56:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair -TR opt: derived-pair3.rkt 57:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- derived pair -TR opt: derived-pair3.rkt 57:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair -TR opt: derived-pair3.rkt 58:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- derived pair -TR opt: derived-pair3.rkt 58:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair -TR opt: derived-pair3.rkt 59:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- derived pair -TR opt: derived-pair3.rkt 59:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair -TR opt: derived-pair3.rkt 60:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- derived pair -TR opt: derived-pair3.rkt 60:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair -TR opt: derived-pair3.rkt 61:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- derived pair -TR opt: derived-pair3.rkt 61:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair -TR opt: derived-pair3.rkt 62:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- derived pair -TR opt: derived-pair3.rkt 62:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair -TR opt: derived-pair3.rkt 63:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- derived pair -TR opt: derived-pair3.rkt 63:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair -TR opt: derived-pair3.rkt 64:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- derived pair -TR opt: derived-pair3.rkt 64:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair -TR opt: derived-pair3.rkt 65:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- derived pair -TR opt: derived-pair3.rkt 65:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair -TR opt: derived-pair3.rkt 66:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- derived pair -TR opt: derived-pair3.rkt 66:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair -TR opt: derived-pair3.rkt 67:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- derived pair -TR opt: derived-pair3.rkt 67:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair -TR opt: derived-pair3.rkt 68:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- derived pair -TR opt: derived-pair3.rkt 68:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair -TR opt: derived-pair3.rkt 69:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- derived pair -TR opt: derived-pair3.rkt 69:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair -TR opt: derived-pair3.rkt 70:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- derived pair -TR opt: derived-pair3.rkt 70:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 103:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- derived pair +TR opt: derived-pair3.rkt 103:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 103:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 103:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 103:0 (caaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 104:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- derived pair +TR opt: derived-pair3.rkt 104:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 104:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 104:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 104:0 (caaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 105:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- derived pair +TR opt: derived-pair3.rkt 105:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 105:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 105:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 105:0 (caadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 106:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- derived pair +TR opt: derived-pair3.rkt 106:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 106:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 106:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 106:0 (caaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 107:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- derived pair +TR opt: derived-pair3.rkt 107:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 107:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 107:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 107:0 (cadaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 108:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- derived pair +TR opt: derived-pair3.rkt 108:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 108:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 108:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 108:0 (cadadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 109:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- derived pair +TR opt: derived-pair3.rkt 109:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 109:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 109:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 109:0 (caddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 110:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- derived pair +TR opt: derived-pair3.rkt 110:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 110:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 110:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 110:0 (cadddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 111:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- derived pair +TR opt: derived-pair3.rkt 111:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 111:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 111:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 111:0 (cdaaar (cons (cons (cons (cons 1 2) 3) 4) 5)) -- pair +TR opt: derived-pair3.rkt 112:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- derived pair +TR opt: derived-pair3.rkt 112:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 112:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 112:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 112:0 (cdaadr (cons 1 (cons (cons (cons 2 3) 4) 5))) -- pair +TR opt: derived-pair3.rkt 113:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- derived pair +TR opt: derived-pair3.rkt 113:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 113:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 113:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 113:0 (cdadar (cons (cons 1 (cons (cons 2 3) 4)) 5)) -- pair +TR opt: derived-pair3.rkt 114:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- derived pair +TR opt: derived-pair3.rkt 114:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 114:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 114:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 114:0 (cdaddr (cons 1 (cons 2 (cons (cons 3 4) 5)))) -- pair +TR opt: derived-pair3.rkt 115:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- derived pair +TR opt: derived-pair3.rkt 115:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 115:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 115:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 115:0 (cddaar (cons (cons (cons 1 (cons 2 3)) 4) 5)) -- pair +TR opt: derived-pair3.rkt 116:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- derived pair +TR opt: derived-pair3.rkt 116:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 116:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 116:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 116:0 (cddadr (cons 1 (cons (cons 2 (cons 3 4)) 5))) -- pair +TR opt: derived-pair3.rkt 117:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- derived pair +TR opt: derived-pair3.rkt 117:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 117:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 117:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 117:0 (cdddar (cons (cons 1 (cons 2 (cons 3 4))) 5)) -- pair +TR opt: derived-pair3.rkt 118:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- derived pair +TR opt: derived-pair3.rkt 118:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 118:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 118:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair +TR opt: derived-pair3.rkt 118:0 (cddddr (cons 1 (cons 2 (cons 3 (cons 4 5))))) -- pair 1 2 2 diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt index 0491657f..b2d56403 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-for.rkt @@ -1,26 +1,30 @@ #; ( -TR opt: unboxed-for.rkt 27:0 #%module-begin -- in-list -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- call to fun with unboxed args -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- fun -> unboxed fun -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unbox float-complex -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed call site -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed function -> table -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed let bindings -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed let loop -TR opt: unboxed-for.rkt 30:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed call site -TR opt: unboxed-for.rkt 30:31 sum -- leave var unboxed -TR opt: unboxed-for.rkt 30:31 sum -- unbox float-complex -TR opt: unboxed-for.rkt 30:31 sum -- unboxed complex variable -TR opt: unboxed-for.rkt 30:31 sum -- unboxed var -> table -TR opt: unboxed-for.rkt 30:53 0.0+0.0i -- unboxed literal -TR opt: unboxed-for.rkt 31:13 i -- unboxed complex variable -TR opt: unboxed-for.rkt 32:6 (+ i sum) -- unboxed float complex -TR opt: unboxed-for.rkt 32:7 + -- unboxed binary float complex -TR opt: unboxed-for.rkt 32:9 i -- leave var unboxed -TR opt: unboxed-for.rkt 32:9 i -- unbox float-complex -TR opt: unboxed-for.rkt 32:11 sum -- leave var unboxed -TR opt: unboxed-for.rkt 32:11 sum -- unbox float-complex +TR opt: unboxed-for.rkt 31:0 #%module-begin -- in-list +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- call to fun with unboxed args +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- fun -> unboxed fun +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unbox float-complex +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed call site +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed function -> table +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed let bindings +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed let bindings +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed let loop +TR opt: unboxed-for.rkt 34:0 (for/fold: : Float-Complex ((sum : Float-Complex 0.0+0.0i)) ((i : Float-Complex (quote (1.0+2.0i 2.0+4.0i)))) (+ i sum)) -- unboxed call site +TR opt: unboxed-for.rkt 34:31 sum -- leave var unboxed +TR opt: unboxed-for.rkt 34:31 sum -- unbox float-complex +TR opt: unboxed-for.rkt 34:31 sum -- unboxed complex variable +TR opt: unboxed-for.rkt 34:31 sum -- unboxed complex variable +TR opt: unboxed-for.rkt 34:31 sum -- unboxed complex variable +TR opt: unboxed-for.rkt 34:31 sum -- unboxed var -> table +TR opt: unboxed-for.rkt 34:53 0.0+0.0i -- unboxed literal +TR opt: unboxed-for.rkt 35:13 i -- unboxed complex variable +TR opt: unboxed-for.rkt 35:13 i -- unboxed complex variable +TR opt: unboxed-for.rkt 36:6 (+ i sum) -- unboxed float complex +TR opt: unboxed-for.rkt 36:7 + -- unboxed binary float complex +TR opt: unboxed-for.rkt 36:9 i -- leave var unboxed +TR opt: unboxed-for.rkt 36:9 i -- unbox float-complex +TR opt: unboxed-for.rkt 36:11 sum -- leave var unboxed +TR opt: unboxed-for.rkt 36:11 sum -- unbox float-complex 3.0+6.0i ) diff --git a/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt index a1d641a5..5a1dc7e1 100644 --- a/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/tests/unboxed-let.rkt @@ -1,21 +1,23 @@ #; ( -TR opt: unboxed-let.rkt 27:0 (let* ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (- t1 3.0+6.0i)) (t3 4.0+8.0i)) (+ t2 t3)) -- unboxed let bindings -TR opt: unboxed-let.rkt 27:12 + -- unboxed binary float complex -TR opt: unboxed-let.rkt 27:14 1.0+2.0i -- unboxed literal -TR opt: unboxed-let.rkt 27:23 2.0+4.0i -- unboxed literal -TR opt: unboxed-let.rkt 28:11 (- t1 3.0+6.0i) -- unboxed float complex -TR opt: unboxed-let.rkt 28:12 - -- unboxed binary float complex -TR opt: unboxed-let.rkt 28:14 t1 -- leave var unboxed -TR opt: unboxed-let.rkt 28:14 t1 -- unbox float-complex -TR opt: unboxed-let.rkt 28:17 3.0+6.0i -- unboxed literal -TR opt: unboxed-let.rkt 29:11 4.0+8.0i -- unboxed literal -TR opt: unboxed-let.rkt 30:2 (+ t2 t3) -- unboxed float complex -TR opt: unboxed-let.rkt 30:3 + -- unboxed binary float complex -TR opt: unboxed-let.rkt 30:5 t2 -- leave var unboxed -TR opt: unboxed-let.rkt 30:5 t2 -- unbox float-complex -TR opt: unboxed-let.rkt 30:8 t3 -- leave var unboxed -TR opt: unboxed-let.rkt 30:8 t3 -- unbox float-complex +TR opt: unboxed-let.rkt 29:0 (let* ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (- t1 3.0+6.0i)) (t3 4.0+8.0i)) (+ t2 t3)) -- unboxed let bindings +TR opt: unboxed-let.rkt 29:0 (let* ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (- t1 3.0+6.0i)) (t3 4.0+8.0i)) (+ t2 t3)) -- unboxed let bindings +TR opt: unboxed-let.rkt 29:0 (let* ((t1 (+ 1.0+2.0i 2.0+4.0i)) (t2 (- t1 3.0+6.0i)) (t3 4.0+8.0i)) (+ t2 t3)) -- unboxed let bindings +TR opt: unboxed-let.rkt 29:12 + -- unboxed binary float complex +TR opt: unboxed-let.rkt 29:14 1.0+2.0i -- unboxed literal +TR opt: unboxed-let.rkt 29:23 2.0+4.0i -- unboxed literal +TR opt: unboxed-let.rkt 30:11 (- t1 3.0+6.0i) -- unboxed float complex +TR opt: unboxed-let.rkt 30:12 - -- unboxed binary float complex +TR opt: unboxed-let.rkt 30:14 t1 -- leave var unboxed +TR opt: unboxed-let.rkt 30:14 t1 -- unbox float-complex +TR opt: unboxed-let.rkt 30:17 3.0+6.0i -- unboxed literal +TR opt: unboxed-let.rkt 31:11 4.0+8.0i -- unboxed literal +TR opt: unboxed-let.rkt 32:2 (+ t2 t3) -- unboxed float complex +TR opt: unboxed-let.rkt 32:3 + -- unboxed binary float complex +TR opt: unboxed-let.rkt 32:5 t2 -- leave var unboxed +TR opt: unboxed-let.rkt 32:5 t2 -- unbox float-complex +TR opt: unboxed-let.rkt 32:8 t3 -- leave var unboxed +TR opt: unboxed-let.rkt 32:8 t3 -- unbox float-complex 4.0+8.0i ) diff --git a/collects/typed-scheme/optimizer/logging.rkt b/collects/typed-scheme/optimizer/logging.rkt index 4942928b..b51dc215 100644 --- a/collects/typed-scheme/optimizer/logging.rkt +++ b/collects/typed-scheme/optimizer/logging.rkt @@ -15,7 +15,7 @@ (format "~a:~a" line col) "(no location)"))) -(struct log-entry (msg pos) #:transparent) +(struct log-entry (msg stx pos) #:transparent) ;; to identify log messages that come from the optimizer ;; to be stored in the data section of log messages @@ -26,7 +26,7 @@ ;; 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 log-so-far '()) (define (gen-log-message msg stx from) (let ([stx (locate-stx stx)]) @@ -39,9 +39,8 @@ (define (log-optimization msg stx #:from [from "TR opt"]) (let* ([new-message (gen-log-message msg stx from)] - [new-entry (log-entry new-message (syntax-position stx))]) - (unless (set-member? log-so-far new-entry) - (set! log-so-far (set-add log-so-far new-entry))))) + [new-entry (log-entry new-message stx (syntax-position stx))]) + (set! log-so-far (cons new-entry log-so-far)))) ;; once the optimizer is done, we sort the log according to source ;; location, then print it @@ -54,9 +53,10 @@ missed-optimizations-log) (for-each (lambda (x) (log-message logger 'warning (log-entry-msg x) optimization-log-key)) - (sort (set->list log-so-far) + (sort (remove-duplicates log-so-far) (match-lambda* - [(list (log-entry msg-x pos-x) (log-entry msg-y pos-y)) + [(list (log-entry msg-x stx-x pos-x) + (log-entry msg-y stx-y pos-y)) (cond [(not (or pos-x pos-y)) ;; neither have location, sort by message (string