[JSC] Extend the strength reduction of B3's BitAnd with booleans
Created attachment 266606 [details] Patch
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)->
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.
Comment on attachment 266606 [details] Patch Clearing flags on attachment: 266606 Committed r193436: <http://trac.webkit.org/changeset/193436>
All reviewed patches have been landed. Closing bug.
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.