[clang] [win][clang] Do not attempt to devirtualize vector destructor call (PR #183741)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 2 04:02:10 PST 2026
Fznamznon wrote:
> This is fragile: it depends on CanDevirtualizeCall here matching the corresponding devirtualization code in EmitObjectDelete. I'd rather not have that implicit coupling.
Thanks for the feedback. I agree. I was thinking that actually stripping the virtual call can be beneficial for optimizations. I also noticed that MSVC does remove the virtual call and replaces it with the loop. The PR title is probably confusing. I should've named it "Fix devirtualization of vector deleting dtor call" instead of "do not attempt".
I tried to move common bits to a separate function, so the checking mechanism is the same. If that doesn't make sense (since I do know very little about optimizations), we can call `emitVirtualObjectDelete()` directly.
https://github.com/llvm/llvm-project/pull/183741
More information about the cfe-commits
mailing list