Cleanup number optimizations.
This commit is contained in:
parent
64064f69d7
commit
50ee4c75b2
|
@ -8,14 +8,11 @@
|
||||||
|
|
||||||
(provide number-opt-expr)
|
(provide number-opt-expr)
|
||||||
|
|
||||||
|
(define-literal-syntax-class unary-op (+ * min max))
|
||||||
|
|
||||||
(define-syntax-class number-opt-expr
|
(define-syntax-class number-opt-expr
|
||||||
#:commit
|
#:commit
|
||||||
;; these cases are all identity
|
;; these cases are all identity
|
||||||
(pattern (#%plain-app (~and op (~or (~literal +) (~literal *)
|
(pattern (#%plain-app op:unary-op f:opt-expr)
|
||||||
(~literal min) (~literal max)))
|
#:do [(log-opt "unary number" "Identity elimination.")]
|
||||||
f:expr)
|
#:with opt #'f.opt))
|
||||||
#:with opt
|
|
||||||
(begin (log-optimization "unary number" "Identity elimination."
|
|
||||||
this-syntax)
|
|
||||||
(add-disappeared-use #'op)
|
|
||||||
((optimize) #'f))))
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user