[llvm-bugs] [Bug 30640] New: [ppc] Shorter sequence to load 64bit constant with same hi/lo parts

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 7 11:17:36 PDT 2016


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

            Bug ID: 30640
           Summary: [ppc] Shorter sequence to load 64bit constant with
                    same hi/lo parts
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: ASSIGNED
          Severity: normal
          Priority: P
         Component: Backend: PowerPC
          Assignee: carrot at google.com
          Reporter: carrot at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Compile following code with options

-m64 -O2 -mvsx -mcpu=power8 

unsigned long long foo()
{
  return 0xcdcdcdcdcdcdcdcdll;
}

LLVM generats:

# BB#0:                                 # %entry
    lis 3, -12851
    ori 3, 3, 52685
    sldi 3, 3, 32
    oris 3, 3, 52685
    ori 3, 3, 52685
    blr


Because the hi/lo parts are same, we can use rldimi to reduce the code
sequence:

    lis 3, -12851
    ori 3, 3, 52685
        rldimi 3, 3, 32, 0

-- 
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/20161007/d81c076b/attachment.html>


More information about the llvm-bugs mailing list