[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-08-06 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: rjmccall, rsmith, hfinkel, jfb. Herald added subscribers: dang, dexonsmith. Herald added a project: clang. fhahn requested review of this revision. After the recent discussion on cfe-dev 'Can indirect class parameters be noalias?' [1], it seems l

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-08-06 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/Basic/LangOptions.def:371-374 +LANGOPT(PassByValueNoAlias, 1, 0, "Allows assuming no references to passed by " + "value escape before transferring execution " +

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-08-07 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 283837. fhahn added a comment. Thanks for taking a look! I adjusted the LangOpts description and added the flag to f_Group, as suggested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85473/new/ https://reviews.

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-08-14 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85473/new/ https://reviews.llvm.org/D85473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-08-24 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85473/new/ https://reviews.llvm.org/D85473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-08-31 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85473/new/ https://reviews.llvm.org/D85473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-03 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Is it acceptable to leave this as a -cc1 option while we're pursuing this with the language committee? Do we have any intent to pursue this with the language committee? Comment at: clang/include/clang/Basic/LangOptions.def:372 +LANGOPT(PassByValueIs

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-08 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 290504. fhahn marked an inline comment as done. fhahn added a comment. Change to codegen option, adjust description for option, limit to trivially copyable types in C++, add corresponding test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-08 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/include/clang/Driver/Options.td:4287-4290 +def fpass_by_value_noalias: Flag<["-"], "fpass-by-value-noalias">, + HelpText<"Allows assuming no references to passed by value escape before " + "transferring execution to the ca

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-10 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 291083. fhahn added a comment. Also restrict to types that are `isNonTrivialToPrimitiveCopy`, so we do not add noalias for problematic types, like ObjC structs with weak references. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://re

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-10 Thread John McCall via Phabricator via cfe-commits
rjmccall added a reviewer: ahatanak. rjmccall added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2198 +// reference to the underlying object. Mark it accordingly. +Attrs.addAttribute(llvm::Attribute::NoAlias); + fhahn wrote: > rjmccal

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 291176. fhahn added a comment. Update code to limit adding noalias to types with `getArgPassingRestrictions() == RecordDecl::APK_CanPassInRegs`. This rules out problematic types, like ones with non-trivial constructors or ObjC structs with weak pointers. Thank

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked an inline comment as done. fhahn added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2198 +// reference to the underlying object. Mark it accordingly. +Attrs.addAttribute(llvm::Attribute::NoAlias); + rjmccall wrote: > fhah

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-11 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 291183. fhahn marked an inline comment as done. fhahn added a comment. Add check lines for escape examples. Note that for return-by-value we already add noalias to the pointer unconditionally. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-11 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Just a minor tweak and then LGTM. Comment at: clang/include/clang/Driver/Options.td:4287-4290 +def fpass_by_value_noalias: Flag<["-"], "fpass-by-value-noalias">, + HelpT

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-12 Thread Florian Hahn via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa874d6334409: [Clang] Add option to allow marking pass-by-value args as noalias. (authored by fhahn). Changed prior to commit: https://reviews.llv

[PATCH] D85473: [Clang] Add option to allow marking pass-by-value args as noalias.

2020-09-12 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/include/clang/Driver/Options.td:4287-4290 +def fpass_by_value_noalias: Flag<["-"], "fpass-by-value-noalias">, + HelpText<"Allows assuming no references to passed by value escape before " + "transferring execution to the ca