<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>152162</bug_id>
          
          <creation_ts>2015-12-10 18:55:27 -0800</creation_ts>
          <short_desc>B3 should be able to sink values into checks</short_desc>
          <delta_ts>2016-02-28 17:50:43 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>152224</dependson>
    
    <dependson>152968</dependson>
          <blocked>152106</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Filip Pizlo">fpizlo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1148391</commentid>
    <comment_count>0</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-12-10 18:55:27 -0800</bug_when>
    <thetext>B3 should sink sinkable operations to the lowest dominating point in the CFG. In case an operation&apos;s output is only used for the stackmap of Check, we should turn this:

    @a = Foo(...)
    Check(@p, @a)

into this:

    Branch(@p, #exit, #continuation)

  exit:
    @a = Foo(...)
    Check(false, @a)

  contination:
    ...

This will help with the useless Shr that we will see on some array bounds checks from asm.js code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148392</commentid>
    <comment_count>1</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-12-10 18:56:11 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; B3 should sink sinkable operations to the lowest dominating point in the
&gt; CFG. In case an operation&apos;s output is only used for the stackmap of Check,
&gt; we should turn this:
&gt; 
&gt;     @a = Foo(...)
&gt;     Check(@p, @a)
&gt; 
&gt; into this:
&gt; 
&gt;     Branch(@p, #exit, #continuation)
&gt; 
&gt;   exit:
&gt;     @a = Foo(...)
&gt;     Check(false, @a)
&gt; 
&gt;   contination:
&gt;     ...
&gt; 
&gt; This will help with the useless Shr that we will see on some array bounds
&gt; checks from asm.js code.

It&apos;s worth saying that usually, https://bugs.webkit.org/show_bug.cgi?id=152160 will obviate the need for this. But things may leak past that optimization. This optimization is more general, but it has a compile time cost due to the introduction of control flow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1148786</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-12-12 22:26:22 -0800</bug_when>
    <thetext>The priority right now is sinking into checks, not general sinking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1169052</commentid>
    <comment_count>3</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2016-02-28 17:50:43 -0800</bug_when>
    <thetext>Note that we could sink anything that the CSE can reason about.  For example, we could sink stores into checks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>