[LLVMbugs] [Bug 12174] New: Suboptimal codegen for <2 x i64> extractelement; store on i386

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Mar 3 14:02:31 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=12174

             Bug #: 12174
           Summary: Suboptimal codegen for <2 x i64> extractelement; store
                    on i386
           Product: new-bugs
           Version: 3.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: arcata at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following IR:

--
define void @foo(<16 x i8> %x, i64* %y) nounwind {
  %1 = bitcast <16 x i8> %x to <2 x i64>
  %2 = extractelement <2 x i64> %1, i32 0
  store i64 %2, i64* %y
  ret void
}
--

is compiled by `llc -mattr=sse2 -mtriple i386--darwin <foo.ll` to:

--
_foo:                                   ## @foo
## BB#0:
    movl    4(%esp), %eax
    pextrd    $1, %xmm0, 4(%eax)
    movd    %xmm0, (%eax)
    ret
--

Instead of `pextrd; movd`, a single `movq %xmm0, (%eax)` instruction could be
used instead.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list