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

            Bug ID: 50045
           Summary: unnamed_addr wrapper function not removed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Testcase:


@foo = global void ()* @bar

declare void @baz();

define internal void @bar() unnamed_addr {
    tail call void @baz()
    ret void
}


I would expect this to be optimized to:


@foo = global void ()* @baz

declare void @baz();


... but it is not. This comes up in C++ for cases such as:

void f();
auto *p = +[]{ f(); }

... where the language rules permit marking the static invoker for the lambda
as unnamed_addr -- the only constraints are on the behavior of the returned
pointer, not on its valid. (Clang doesn't do this yet.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to