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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to