Bug 150656 - B3::reduceStrength() should do DCE
Summary: B3::reduceStrength() should do DCE
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: 150507
  Show dependency treegraph
 
Reported: 2015-10-28 18:45 PDT by Filip Pizlo
Modified: 2015-10-28 18:58 PDT (History)
11 users (show)

See Also:


Attachments
the patch (7.20 KB, patch)
2015-10-28 18:49 PDT, Filip Pizlo
sbarati: 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-10-28 18:45:54 PDT
Here's what my rough DCE can do:

B3 after initial, before reduceStrength:
BB#0: ; frequency = nan
    Int64 @0 = ArgumentReg(%rdi)
    Int64 @1 = Const64(0)
    Int64 @2 = Add(@0, @1)
    Int32 @3 = Load(@2, ControlDependent|Reads:Top)
    Int64 @4 = Const64(4)
    Int64 @5 = Add(@0, @4)
    Int32 @6 = Load(@5, ControlDependent|Reads:Top)
    Int32 @7 = Add(@3, @6)
    Void @8 = Return(@7, Terminal)
B3 after reduceStrength, before lowerToAir:
BB#0: ; frequency = nan
    Int64 @0 = ArgumentReg(%rdi)
    Int32 @3 = Load(@0, ControlDependent|Reads:Top)
    Int32 @6 = Load(@0, offset = 4, ControlDependent|Reads:Top)
    Int32 @7 = Add(@3, @6)
    Void @8 = Return(@7, Terminal)
Comment 1 Filip Pizlo 2015-10-28 18:49:07 PDT
Created attachment 264284 [details]
the patch
Comment 2 WebKit Commit Bot 2015-10-28 18:51:05 PDT
Attachment 264284 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/b3/B3ProcedureInlines.h:39:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Filip Pizlo 2015-10-28 18:53:14 PDT
(In reply to comment #2)
> Attachment 264284 [details] did not pass style-queue:
> 
> 
> ERROR: Source/JavaScriptCore/b3/B3ProcedureInlines.h:39:  More than one
> command on the same line  [whitespace/newline] [4]
> Total errors found: 1 in 7 files
> 
> 
> If any of these errors are false positives, please file a bug against
> check-webkit-style.

Fixed.
Comment 4 Saam Barati 2015-10-28 18:56:54 PDT
Comment on attachment 264284 [details]
the patch

LGTM
Comment 5 Filip Pizlo 2015-10-28 18:58:26 PDT
Landed in http://trac.webkit.org/changeset/191718