<?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>151997</bug_id>
          
          <creation_ts>2015-12-08 10:01:00 -0800</creation_ts>
          <short_desc>DFG should reduce division of a constant by a constant.</short_desc>
          <delta_ts>2015-12-08 10:34:26 -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 Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>benjamin</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>keith_miller</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1147331</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2015-12-08 10:01:00 -0800</bug_when>
    <thetext>Running LayoutTests/svg/in-html/sizing/svg-inline.html produces a scenario where we see a division of a constant by another constant:

    (lldb) p leftOperand
    (JSC::SnippetOperand) $0 = {
      m_resultType = (m_type = &apos;\x05&apos;)
      m_type = ConstInt32
      m_val = (int32Val = 600, doubleVal = 6.0841863318852727E-310, rawBits = 123145302311512)
    }
    (lldb) p rightOperand
    (JSC::SnippetOperand) $1 = {
      m_resultType = (m_type = &apos;\x05&apos;)
      m_type = ConstInt32
      m_val = (int32Val = 100, doubleVal = 6.0841863318605694E-310, rawBits = 123145302311012)
    }

The DFG should have folded this into a constant int 6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1147346</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-12-08 10:25:26 -0800</bug_when>
    <thetext>&lt;rdar://problem/23804458&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1147351</commentid>
    <comment_count>2</comment_count>
    <who name="Filip Pizlo">fpizlo</who>
    <bug_when>2015-12-08 10:34:26 -0800</bug_when>
    <thetext>Please postpone this work until we have a complete story for prediction propagation from snippets. And when you do implement this please make sure that you do it in the abstract interpreter and that the snippets continue to work even if they see constant inputs. We do not guarantee complete constant folding as a prerequisite for code generation.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>