[llvm-bugs] [Bug 50011] New: Inline "noinline" function if becomes empty

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Apr 17 03:56:32 PDT 2021


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

            Bug ID: 50011
           Summary: Inline "noinline" function if becomes empty
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

static void *ptr1, *ptr2;

static void doit(void **pptr, int cond)
{
  if (cond) {
    *pptr = &ptr2;
  }
}

__attribute__ ((noinline))
static void f(int cond)
{
  doit (&ptr1, cond);
}


int main()
{
  f (1);
}



llvm -O3:
main:                                   # @main
        push    rax
        call    f
        xor     eax, eax
        pop     rcx
        ret
f:                                      # @f
        ret

https://godbolt.org/z/7387cer5j

-- 
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/20210417/dac97f12/attachment.html>


More information about the llvm-bugs mailing list