<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [x86, SSE] should -1 vector constant creation be domain aware?"
   href="https://llvm.org/bugs/show_bug.cgi?id=28129">28129</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86, SSE] should -1 vector constant creation be domain aware?
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Disregard that we're adding NaN values here to just focus on the isel. :)

define <2 x double> @cmp_domain(<2 x double> %a) {
  %cmp = fcmp oeq <2 x double> zeroinitializer, zeroinitializer
  %sext = sext <2 x i1> %cmp to <2 x i64>
  %mask = bitcast <2 x i64> %sext to <2 x double>
  %add = fadd <2 x double> %a, %mask
  ret <2 x double> %add
}

$ ./llc -o - cmp_domain.ll 
    pcmpeqd    %xmm1, %xmm1
    addpd    %xmm1, %xmm0
    retq

-----------------------------------------------------------------------------

The splat of -1 (NaN) is using an integer domain instruction (pcmpeqd), and
that's getting used by an FP domain instruction. 

I'm not sure if this is an actual problem for any CPU...because the
splat-ones-creating-instruction should be recognized as an idiom and not
actually require any execution resources?

But I noticed this as part of:
<a href="http://reviews.llvm.org/D21269">http://reviews.llvm.org/D21269</a>

If we do want to fix this, I think we need to see what happens (in ExeDepsFix?)
to X86::V_SETALLONES versus X86::V_SET0.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>