[PATCH] D32378: Insert invariant.group.barrier for pointers comparisons

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 23 09:40:02 PDT 2017


Prazek marked an inline comment as done.
Prazek added inline comments.


================
Comment at: lib/CodeGen/CGExprScalar.cpp:3066-3067
+    } else { // Unsigned integers and pointers.
+      if (CGF.CGM.getCodeGenOpts().StrictVTablePointers &&
+          CGF.CGM.getCodeGenOpts().OptimizationLevel > 0) {
+        // Based on comparisons of pointers to dynamic objects, the optimizer
----------------
rsmith wrote:
> I think we need to do this regardless of optimization level -- if we LTO together a -O0 translation unit with a -O2 translation unit, we still need this protection for the comparisons in the -O0 TU.
> 
> (IIRC we chose to make -fstrict-vtable-pointers an IR-level ABI break, but we shouldn't do the same thing for optimization level.)
sounds good


https://reviews.llvm.org/D32378





More information about the cfe-commits mailing list