[LLVMbugs] [Bug 20182] New: Missing optimization: linkonce_odr stuff only referenced by available externally globals is not discarded

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 1 11:52:57 PDT 2014


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

            Bug ID: 20182
           Summary: Missing optimization: linkonce_odr stuff only
                    referenced by available externally globals is not
                    discarded
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: rnk at google.com
                CC: david.majnemer at gmail.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:

@x = available_externally constant void()* @f

define linkonce_odr void @f() {
  ret void
}

define i32 @main() {
  %f = load void()** @x
  call void %f()
  ret i32 0
}


@x references @f.  @x will not be emitted, and @f is discardable, so we should
discard it if that's the only reference.

This is relevant for dllimported vftable thunks in the MS ABI, because they are
not actually available externally.  We emit them for devirtualization of
thunks, but we cannot actually import them.

-- 
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/20140701/6e332e02/attachment.html>


More information about the llvm-bugs mailing list