mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-06 04:36:36 +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)
|
||||
(cond
|
||||
((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
|
||||
`(if ,(opt:inline-prims (if->condition exp) refs)
|
||||
,(opt:inline-prims (if->then exp) refs)
|
||||
|
|
Loading…
Add table
Reference in a new issue