================
@@ -1131,12 +1120,6 @@ bool DevirtModule::tryFindVirtualCallTargets(
if (Fn->getName() == "__cxa_pure_virtual")
continue;
- // In most cases empty functions will be overridden by the
- // implementation of the derived class, so we can skip them.
- if (DevirtSpeculatively && Fn->getReturnType()->isVoidTy() &&
----------------
hassnaaHamdi wrote:
We need it in non-LTO mode. If there is a virtual function with empty body,
most probably it'll be overridden by the derived class, and most probably the
only target we would have at that moment is the base class, so in most cases
the speculation would be wrong. That's why it's better to drop it.
I don't think having a cost model is related to this case.
https://github.com/llvm/llvm-project/pull/233380
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits