Bug 150958 - B3::reduceStrength should canonicalize integer comparisons
Summary: B3::reduceStrength should canonicalize integer comparisons
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on: 150721
Blocks: 154319 183543
  Show dependency treegraph
 
Reported: 2015-11-05 15:06 PST by Filip Pizlo
Modified: 2018-03-12 17:24 PDT (History)
10 users (show)

See Also:


Attachments
Patch (10.88 KB, patch)
2018-03-10 12:10 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (10.80 KB, patch)
2018-03-10 12:11 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2015-11-05 15:06:51 PST
Integer comparisons are not necessarily commutative, but you can swap the operands if you also flip the comparison - for example you can turn LessThan(const, var) into GreaterThan(var, const).  We should use this property to "sort" the operands the same way we do for commutative operations.

This will let us get rid of a lot of cases in the B3::lowerToAir() pattern matching.
Comment 1 Yusuke Suzuki 2018-03-10 12:10:17 PST
Created attachment 335517 [details]
Patch
Comment 2 Yusuke Suzuki 2018-03-10 12:11:34 PST
Created attachment 335518 [details]
Patch
Comment 3 Yusuke Suzuki 2018-03-10 22:50:29 PST
Comment on attachment 335518 [details]
Patch

Thanks!
Comment 4 WebKit Commit Bot 2018-03-10 23:16:20 PST
Comment on attachment 335518 [details]
Patch

Clearing flags on attachment: 335518

Committed r229513: <https://trac.webkit.org/changeset/229513>
Comment 5 WebKit Commit Bot 2018-03-10 23:16:21 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Yusuke Suzuki 2018-03-11 09:51:04 PDT
Oops, this patch may create an orphan value which is not allowed by B3Validate.
It is also fixed in bug 183543.
Comment 7 Radar WebKit Bug Importer 2018-03-12 17:24:21 PDT
<rdar://problem/38397856>