RESOLVED FIXED 151852
[JSC] Extend the strength reduction of B3's BitAnd with booleans
https://bugs.webkit.org/show_bug.cgi?id=151852
Summary [JSC] Extend the strength reduction of B3's BitAnd with booleans
Benjamin Poulain
Reported 2015-12-03 23:33:27 PST
[JSC] Extend the strength reduction of B3's BitAnd with booleans
Attachments
Patch (5.14 KB, patch)
2015-12-03 23:35 PST, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2015-12-03 23:35:15 PST
Saam Barati
Comment 2 2015-12-04 00:59:07 PST
Comment on attachment 266606 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=266606&action=review r=me > Source/JavaScriptCore/b3/B3ReduceStrength.cpp:578 > + && m_value->child(0)->child(1)->asInt() & 1 I think you could also do: "m_value->child(0)->
Saam Barati
Comment 3 2015-12-04 01:00:00 PST
Comment on attachment 266606 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=266606&action=review >> Source/JavaScriptCore/b3/B3ReduceStrength.cpp:578 >> + && m_value->child(0)->child(1)->asInt() & 1 > > I think you could also do: "m_value->child(0)-> Oops I meant to delete that.
WebKit Commit Bot
Comment 4 2015-12-04 12:31:29 PST
Comment on attachment 266606 [details] Patch Clearing flags on attachment: 266606 Committed r193436: <http://trac.webkit.org/changeset/193436>
WebKit Commit Bot
Comment 5 2015-12-04 12:31:32 PST
All reviewed patches have been landed. Closing bug.
Filip Pizlo
Comment 6 2015-12-14 18:18:10 PST
Comment on attachment 266606 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=266606&action=review > Source/JavaScriptCore/b3/B3ReduceStrength.cpp:869 > + // Turn this: Branch(BitAnd(bool, xyb1), then, else) > + // Into this: Branch(bool, then, else) > + if (branch->child(0)->opcode() == BitAnd > + && branch->child(0)->child(1)->hasInt() > + && branch->child(0)->child(1)->asInt() & 1 > + && branch->child(0)->child(0)->returnsBool()) { > + branch->child(0) = branch->child(0)->child(0); > + m_changed = true; > + } > + You could have made this a rule that converts BitAnd(bool, xyb1) to bool, regardless of the user of the BitAnd.
Note You need to log in before you can comment on or make changes to this bug.