[PATCH] D32401: [Devirtualization] insert placement new barrier with -O0

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 23 10:00:37 PDT 2017


Prazek created this revision.
Herald added a subscriber: mehdi_amini.

To not break LTO with different optimizations levels, we should insert
the barrier regardles of optimization level.


https://reviews.llvm.org/D32401

Files:
  lib/CodeGen/CGExprCXX.cpp


Index: lib/CodeGen/CGExprCXX.cpp
===================================================================
--- lib/CodeGen/CGExprCXX.cpp
+++ lib/CodeGen/CGExprCXX.cpp
@@ -1658,8 +1658,9 @@
 
   // Passing pointer through invariant.group.barrier to avoid propagation of
   // vptrs information which may be included in previous type.
+  // To not break LTO with different optimizations levels, we do it regardless
+  // of optimization level.
   if (CGM.getCodeGenOpts().StrictVTablePointers &&
-      CGM.getCodeGenOpts().OptimizationLevel > 0 &&
       allocator->isReservedGlobalPlacementOperator())
     result = Address(Builder.CreateInvariantGroupBarrier(result.getPointer()),
                      result.getAlignment());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32401.96313.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170423/0ccf4c24/attachment.bin>


More information about the cfe-commits mailing list