[LLVMbugs] [Bug 13572] New: [Hexagon] LLVM is unnecessarily saving and restoring callee-saved registers and also generating allocframe and dealloc frame

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 10 08:00:15 PDT 2012


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

             Bug #: 13572
           Summary: [Hexagon] LLVM is unnecessarily saving and restoring
                    callee-saved registers and also generating allocframe
                    and dealloc frame
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: pranavb at codeaurora.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9032
  --> http://llvm.org/bugs/attachment.cgi?id=9032
Testcase to reproduce this problem

Consider a simple function that has a tail call in it.
$> cat simpletailcall.i
# 1 "simpletailcall.c"
# 1 "simpletailcall.c" 1
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 123 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "simpletailcall.c" 2


extern int x;
void foo_empty (int h)
{

  bar_empty (h+3);
}
**************************************((
llc -march=hexagon -mcpu=hexagonv4 < simpletailcall.ll
        .file   "<stdin>"
        .text
        .globl  foo_empty
        .align  4
        .type   foo_empty, at function
foo_empty:                              // @foo_empty
// BB#0:                                // %entry
        allocframe(#32)
      {
        memd(r29 + #24) = r17:16
        memd(r29 + #16) = r19:18
      }
      {
        memd(r29 + #8) = r21:20
        memd(r29 + #0) = r23:22
        r0 = add(r0, #3)
      }
      {
        r17:16 = memd(r29 + #24)
        r19:18 = memd(r29 + #16)
      }
      {
        r21:20 = memd(r29 + #8)
        r23:22 = memd(r29 + #0)
      }
        deallocframe
        jump bar_empty // TAILCALL
.Ltmp0:
        .size   foo_empty, .Ltmp0-foo_empty
*******************************************
The callee-saves and allocframe are unnecessary.

$>llc --version
LLVM (http://llvm.org/):
  LLVM version 3.2svn
  DEBUG build with assertions.
  Built Aug  9 2012 (13:10:17).
  Default target: x86_64-unknown-linux-gnu
  Host CPU: corei7-avx

-- 
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