[llvm-bugs] [Bug 34917] New: Shrink wrapping rarely fires on platforms with no regparms (i686)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 11 10:35:02 PDT 2017


            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: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: llvm-bugs at 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)
  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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171011/72e4b4d8/attachment.html>

More information about the llvm-bugs mailing list