Bug 151852 - [JSC] Extend the strength reduction of B3's BitAnd with booleans
Summary: [JSC] Extend the strength reduction of B3's BitAnd with booleans
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 23:33 PST by Benjamin Poulain
Modified: 2015-12-14 18:18 PST (History)
5 users (show)

See Also:


Attachments
Patch (5.14 KB, patch)
2015-12-03 23:35 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2015-12-03 23:33:27 PST
[JSC] Extend the strength reduction of B3's BitAnd with booleans
Comment 1 Benjamin Poulain 2015-12-03 23:35:15 PST
Created attachment 266606 [details]
Patch
Comment 2 Saam Barati 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)->
Comment 3 Saam Barati 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.
Comment 4 WebKit Commit Bot 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>
Comment 5 WebKit Commit Bot 2015-12-04 12:31:32 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Filip Pizlo 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.