Open rnk opened 10 years ago
Still repros, still seems relevant for reducing object file size on Windows, where there are lots of available_externally vtables from dllimport stuff. I might re-look into this.
The fix was reverted.
r212337 should help.
Extended Description
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.