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

2017-05-03 Thread Piotr Padlewski via Phabricator via cfe-commits
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

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

2017-04-30 Thread Hubert Tong via Phabricator via cfe-commits
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

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

2017-04-24 Thread Piotr Padlewski via Phabricator via cfe-commits
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

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

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
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

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

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
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

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

2017-04-23 Thread Piotr Padlewski via Phabricator via cfe-commits
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

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

2017-04-21 Thread Richard Smith via Phabricator via cfe-commits
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