[llvm-bugs] [Bug 24817] New: inefficient floating point register ld/st instructions are generated when -mcpu=power8 is specified

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Sep 14 15:08:17 PDT 2015


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

            Bug ID: 24817
           Summary: inefficient floating point register ld/st instructions
                    are generated when -mcpu=power8 is specified
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: unassignedbugs at nondot.org
          Reporter: carrot at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The simple test case is:

int foo(float *p)
{
  float f1 = p[1];
  float f2 = p[2];
  return f1 > f2;
}

Compiler command line and output

clang -S t8.c --target=powerpc -m64 -mcpu=power8 -O2
    li 4, 4             // A
    li 5, 8             // B
    lxsspx 0, 3, 4      // C
    lxsspx 1, 3, 5      // D
    li 3, 0
    li 4, 1
    fcmpu 0, 0, 1
    isel 3, 4, 3, 1
    blr


If I change -mcpu=power8 to -mcpu=power7, I got

    lfs 0, 4(3)        // E
    lfs 1, 8(3)        // F
    li 3, 0
    li 4, 1
    fcmpu 0, 0, 1
    isel 3, 4, 3, 1
    blr

Instructions AC are replaced by E
Instructions BD are replaced by F

-- 
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/20150914/2dbcdab9/attachment.html>


More information about the llvm-bugs mailing list