Bug 151124 - B3 should be able to compile and canonicalize Mul
Summary: B3 should be able to compile and canonicalize Mul
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks: 150279
  Show dependency treegraph
 
Reported: 2015-11-10 18:58 PST by Filip Pizlo
Modified: 2015-11-11 12:35 PST (History)
11 users (show)

See Also:


Attachments
work in progress (15.82 KB, patch)
2015-11-10 18:59 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
a bit more (23.19 KB, patch)
2015-11-10 19:47 PST, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (29.87 KB, patch)
2015-11-10 21:20 PST, Filip Pizlo
ggaren: review+
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-10 18:58:03 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2015-11-10 18:59:23 PST
Created attachment 265260 [details]
work in progress
Comment 2 Filip Pizlo 2015-11-10 19:47:01 PST
Created attachment 265261 [details]
a bit more
Comment 3 Filip Pizlo 2015-11-10 21:20:41 PST
Created attachment 265268 [details]
the patch
Comment 4 WebKit Commit Bot 2015-11-10 21:23:42 PST
Attachment 265268 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/b3/B3ConstDoubleValue.h:47:  The parameter name "proc" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/b3/testb3.cpp:209:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/b3/testb3.cpp:302:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/b3/testb3.cpp:2855:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/JavaScriptCore/b3/testb3.cpp:2861:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 5 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Geoffrey Garen 2015-11-10 21:32:59 PST
Comment on attachment 265268 [details]
the patch

View in context: https://bugs.webkit.org/attachment.cgi?id=265268&action=review

r=me

> Source/JavaScriptCore/b3/B3ReduceStrength.cpp:227
> +                // Turn this: Mul(value, 1)
> +                // Into this: value
> +                if (factor == 1) {
> +                    m_value->replaceWithIdentity(m_value->child(0));
> +                    break;
> +                }

Should we do -1 here?
Comment 6 Filip Pizlo 2015-11-10 21:40:54 PST
(In reply to comment #5)
> Comment on attachment 265268 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=265268&action=review
> 
> r=me
> 
> > Source/JavaScriptCore/b3/B3ReduceStrength.cpp:227
> > +                // Turn this: Mul(value, 1)
> > +                // Into this: value
> > +                if (factor == 1) {
> > +                    m_value->replaceWithIdentity(m_value->child(0));
> > +                    break;
> > +                }
> 
> Should we do -1 here?

Good point!  We should.
Comment 7 Filip Pizlo 2015-11-11 12:35:49 PST
Landed in http://trac.webkit.org/changeset/192320