r303488 - [Devirtualization] insert placement new barrier with -O0
Piotr Padlewski via cfe-commits
cfe-commits at lists.llvm.org
Sat May 20 01:56:18 PDT 2017
Author: prazek
Date: Sat May 20 03:56:18 2017
New Revision: 303488
URL: http://llvm.org/viewvc/llvm-project?rev=303488&view=rev
Log:
[Devirtualization] insert placement new barrier with -O0
Summary:
To not break LTO with different optimizations levels, we should insert
the barrier regardles of optimization level.
Reviewers: rjmccall, rsmith, mehdi_amini
Reviewed By: mehdi_amini
Subscribers: mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D32401
Modified:
cfe/trunk/lib/CodeGen/CGExprCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=303488&r1=303487&r2=303488&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Sat May 20 03:56:18 2017
@@ -1658,8 +1658,9 @@ llvm::Value *CodeGenFunction::EmitCXXNew
// 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());
More information about the cfe-commits
mailing list