Handbook
Glossary
fuse-multiply-negate ( cfg -- )
Vocabulary
compiler
.
cfg
.
multiply-negate
Inputs
cfg
an
object
Outputs
None
Definition
USING:
accessors
assocs
compiler.cfg
compiler.cfg.def-use
compiler.cfg.instructions
compiler.cfg.rpo
kernel
sequences
;
IN:
compiler.cfg.multiply-negate
::
fuse-multiply-negate
( cfg -- )
cfg
post-order
:>
blocks blocks
[
instructions>>
[
##neg?
]
any?
]
any?
[
H{
}
clone
:>
definitions
H{
}
clone
:>
use-counts blocks
[
instructions>>
[|
insn |
insn
defs-vregs
[
insn
swap
definitions
set-at
]
each
insn
uses-vregs
[
use-counts
inc-at
]
each
]
each
]
each
cfg
[
[
definitions use-counts
fuse-negated-product
]
map
]
simple-optimization
cfg
cfg-changed
]
when
;