mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-06 12:46:35 +02:00
Fix and attempt to improve (if) optimization
This commit is contained in:
parent
0fb83a8100
commit
6643eeb083
1 changed files with 3 additions and 1 deletions
|
@ -450,7 +450,9 @@
|
||||||
((if? exp)
|
((if? exp)
|
||||||
(cond
|
(cond
|
||||||
((not (if->condition exp))
|
((not (if->condition exp))
|
||||||
(opt:contract (if->else exp)))
|
(opt:inline-prims (if->else exp) refs)) ;; Always false, so replace with else
|
||||||
|
((const? (if->condition exp))
|
||||||
|
(opt:inline-prims (if->then exp) refs)) ;; Always true, replace with then
|
||||||
(else
|
(else
|
||||||
`(if ,(opt:inline-prims (if->condition exp) refs)
|
`(if ,(opt:inline-prims (if->condition exp) refs)
|
||||||
,(opt:inline-prims (if->then exp) refs)
|
,(opt:inline-prims (if->then exp) refs)
|
||||||
|
|
Loading…
Add table
Reference in a new issue