[PATCH] D46441: [clang][CodeGenCXX] Noalias attr for copy/move constructor arguments
Anton Bikineev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat May 12 05:17:23 PDT 2018
AntonBikineev updated this revision to Diff 146469.
AntonBikineev added a comment.
Herald added a reviewer: javed.absar.
Richard,
Thanks for the remarkable note. I've updated the patch and marked the first `llvm::Function` parameter with `noalias` attribute. Please notice, that this is not the only place where the position of the `this` pointer is assumed to always be first. As an example, another such place is here <https://clang.llvm.org/doxygen/CGCall_8cpp_source.html#l00293>. Maybe we will have to generalize it in `CGCXXABI` down the road...
> I think this standard text is in error and UB would be appropriate, but we should at least discuss whether we want to take this additional liberty not technically granted by the standard.
Should we then file an issue to the Core?
BTW, gcc already performs this opt since 8.1: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899#c10
https://reviews.llvm.org/D46441
Files:
lib/CodeGen/CodeGenModule.cpp
test/CXX/except/except.spec/p14-ir.cpp
test/CodeGenCXX/arm.cpp
test/CodeGenCXX/arm64-constructor-return.cpp
test/CodeGenCXX/constructor-destructor-return-this.cpp
test/CodeGenCXX/constructor-init.cpp
test/CodeGenCXX/constructors.cpp
test/CodeGenCXX/copy-constructor-elim-2.cpp
test/CodeGenCXX/copy-constructor-synthesis-2.cpp
test/CodeGenCXX/copy-constructor-synthesis.cpp
test/CodeGenCXX/cxx0x-delegating-ctors.cpp
test/CodeGenCXX/default-arg-temps.cpp
test/CodeGenCXX/default-arguments.cpp
test/CodeGenCXX/dllexport-members.cpp
test/CodeGenCXX/dllimport-members.cpp
test/CodeGenCXX/dllimport.cpp
test/CodeGenCXX/eh.cpp
test/CodeGenCXX/float128-declarations.cpp
test/CodeGenCXX/implicit-copy-constructor.cpp
test/CodeGenCXX/mangle-subst-std.cpp
test/CodeGenCXX/member-init-assignment.cpp
test/CodeGenCXX/member-templates.cpp
test/CodeGenCXX/microsoft-abi-eh-cleanups.cpp
test/CodeGenCXX/microsoft-abi-extern-template.cpp
test/CodeGenCXX/microsoft-abi-structors.cpp
test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
test/CodeGenCXX/microsoft-interface.cpp
test/CodeGenCXX/pod-member-memcpys.cpp
test/CodeGenCXX/pointers-to-data-members.cpp
test/CodeGenCXX/pr13396.cpp
test/CodeGenCXX/template-anonymous-types.cpp
test/CodeGenCXX/template-instantiation.cpp
test/CodeGenCXX/value-init.cpp
test/CodeGenCXX/virtual-bases.cpp
test/CodeGenCXX/vtable-pointer-initialization.cpp
test/CodeGenCXX/wasm-args-returns.cpp
test/CodeGenObjCXX/implicit-copy-constructor.mm
test/OpenMP/declare_target_codegen.cpp
test/OpenMP/parallel_private_codegen.cpp
test/OpenMP/teams_private_codegen.cpp
test/OpenMP/threadprivate_codegen.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46441.146469.patch
Type: text/x-patch
Size: 109260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180512/6a81faa0/attachment-0001.bin>
More information about the cfe-commits
mailing list