Turning on opaque pointers has uncovered an issue with WPD where we currently pattern match away assume(type.test) in WPD so that a later LTT doesn't resolve the type test to undef and introduce an assume(false). The pattern matching can fail in cases where we transform two assume(type.test)s into assume(phi(type.test.1, type.test.2)).
Currently we create assume(type.test) for all virtual calls that might be devirtualized. This is to support -Wl,--lto-whole-program-visibility.
To prevent this, all virtual calls that may not be in the same LTO module instead use a new llvm.public.type.test intrinsic in place of the llvm.type.test. Then when we know if -Wl,--lto-whole-program-visibility is passed or not, we can either replace all llvm.public.type.test with llvm.type.test, or replace all llvm.public.type.test with true. This prevents WPD from trying to pattern match away assume(type.test) for public virtual calls when failing the pattern matching will result in miscompiles.
Remove commented debugging code here and below