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

            Bug ID: 34917
           Summary: Shrink wrapping rarely fires on platforms with no
                    regparms (i686)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedb...@nondot.org
          Reporter: r...@google.com
                CC: llvm-bugs@lists.llvm.org

Consider this program targetting i686-windows-msvc:

int doSomething(int*);
int /*__fastcall*/ shrink_wrap_basic(int a, int b, int c, int d) {
  if (a < b)
    return a;
  for (int i = c; i < d; ++i)
    doSomething(&c);
  return doSomething(&c);
}

We can shrink wrap here successfully so long as 'a' and 'b' are passed in
ECX/EDX, i.e. when __fastcall is uncommented.

Most functions are not marked fastcall, and parameters are passed on the stack.
Shrink wrapping checks for uses of CSRs and frame indices before the split
point. However, this check is too limiting. We can probably separate fixed
frame indices for arguments from fixed frame indices in the current function's
frame by checking the offset to ensure that it is in the caller's frame.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to