RESOLVED FIXED Bug 150775
B3::LowerToAir should do copy propagation
https://bugs.webkit.org/show_bug.cgi?id=150775
Summary B3::LowerToAir should do copy propagation
Filip Pizlo
Reported 2015-11-01 09:19:09 PST
For example, the Trunc value in B3 is really just an identity in Air. Currently we emit a Move. But, it would be more efficient to copy propagate: just set the tmp of the Trunc to the tmp of the input. We could do similar things for ZExt and SExt. For ZExt, we could record if the tmp for the input value was produced by an instruction that already zero-extends. For SExt, we could record if the tmp for the input value was produced by an instruction that already sign-extends. For both of them, we could also use an analysis of whether the input is non-negative. If so, the we could copy-propagate through ZExt and SExt provided that the source either zero- or sign-extended. For example, we could copy-prop through a SExt if the source zero-extended and the value is proved non-negative.
Attachments
the patch (6.79 KB, patch)
2015-11-03 12:24 PST, Filip Pizlo
no flags
the patch (7.01 KB, patch)
2015-11-03 12:27 PST, Filip Pizlo
ggaren: review+
Filip Pizlo
Comment 1 2015-11-01 09:20:45 PST
Interestingly though, we may not need to do anything special for SExt. The FTL is already smart enough to use ZExt in all those cases where the input is non-negative.
Filip Pizlo
Comment 2 2015-11-03 12:24:06 PST
Created attachment 264709 [details] the patch
Filip Pizlo
Comment 3 2015-11-03 12:27:10 PST
Created attachment 264710 [details] the patch
Geoffrey Garen
Comment 4 2015-11-03 13:13:53 PST
Comment on attachment 264710 [details] the patch r=me
Filip Pizlo
Comment 5 2015-11-03 14:05:02 PST
Note You need to log in before you can comment on or make changes to this bug.