Prazek added a comment.
In https://reviews.llvm.org/D32378#741989, @hubert.reinterpretcast wrote:
> Has it been discussed whether this is something to be addressed in the
> optimizer as opposed to the front-end?
The example that you showed is excellent. I didn't know that LLVM does the
transf
hubert.reinterpretcast added a comment.
Has it been discussed whether this is something to be addressed in the
optimizer as opposed to the front-end?
Comment at: lib/CodeGen/CGExprScalar.cpp:3069
+ !isa(RHS)) {
+// Based on comparisons of pointers to dynamic o
Prazek updated this revision to Diff 96371.
Prazek added a comment.
Don't add barrier if compared with nullptr. With this it reduces added
barriers to compares by half. Note that we will transform barrier(null) ->
barrier
in llvm
https://reviews.llvm.org/D32378
Files:
lib/CodeGen/CGExprScal
Prazek added a comment.
This is actually good catch, we also need to do it when inserting barrier in
placement new.
I think that for the ctors and dtors we can do it only with optimizations
enabled, because if optimizations are not enabled then ctors and dtors won't
have the invariant.group in
Prazek updated this revision to Diff 96311.
Prazek marked an inline comment as done.
Prazek added a comment.
Addressing Richard's comment
https://reviews.llvm.org/D32378
Files:
lib/CodeGen/CGExprScalar.cpp
test/CodeGenCXX/strict-vtable-pointers.cpp
Index: test/CodeGenCXX/strict-vtable-poin
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().OptimizationL
rsmith 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 comparis