Bug 150656

Summary: B3::reduceStrength() should do DCE
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, commit-queue, ggaren, mark.lam, mhahnenb, msaboff, nrotem, oliver, saam, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 150507    
Attachments:
Description Flags
the patch saam: review+

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