Re:The Performance Impact of C++'s `final` Keyword
by nwallin on Monday April 22, 2024 @05:32PM
(#40121330)
You appear to be correct. Clang does not devirtualize in LTO, but GCC does. Personally I consider this very strange.
[ Parent
| on HN ]
Re:The Performance Impact of C++'s `final` Keyword
by ranger_danger on Monday April 22, 2024 @09:22PM
(#40127454)
What if you add -fwhole-program-vtables on clang?
Re:The Performance Impact of C++'s `final` Keyword
by JonChesterfield on Tuesday April 23, 2024 @07:20PM
(#40138520)
I think this is a bug. There's dedicated metadata that's supposed to end up on the indirect call to list the possible targets and when that list of possible targets is this short it should be turning into a switch over concrete targets. Don't have time to dig into the IR now but it might be worth posting to the github llvm issues.