[llvm-bugs] [Bug 28129] New: [x86, SSE] should -1 vector constant creation be domain aware?

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 14 09:51:54 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28129

            Bug ID: 28129
           Summary: [x86, SSE] should -1 vector constant creation be
                    domain aware?
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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:
http://reviews.llvm.org/D21269

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160614/a6179aa5/attachment-0001.html>


More information about the llvm-bugs mailing list