[PATCH] D84999: dynamic_cast optimization in LTO

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 10:34:42 PDT 2020


steven_wu added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/DynamicCastOpt.cpp:15
+// types, and B is a public base class of T, then an equivalent expression is:
+//    typeid(T) == typeid(*expr)
+//
----------------
I think this needs to be `operator==` for `std::typeinfo` for this to work for non-unique RTTI. The current pass seems to lower this into `icmp` which might cause miscompile. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84999/new/

https://reviews.llvm.org/D84999



More information about the llvm-commits mailing list