[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-15 Thread Johannes Doerfert 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 rGb9c77542e237: [Clang][Attr] Introduce the `assume` function attribute (authored by jdoerfert). Changed prior to commit: https://reviews.llvm.org/D

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM (found one very minor late nit in a cmake file though). Thank you for the discussion on this! Comment at: clang/lib/Sema/CMakeLists.txt:3 FrontendOpenM

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-15 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:1689 + +llvm::StringSet<> Sema::KnownAssumptionStrings({ +"omp_no_openmp", // OpenMP 5.1 aaron.ballman wrote: > The current approach is reasonable, but I wonder if there's a

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-15 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 311922. jdoerfert marked 5 inline comments as done. jdoerfert added a comment. Addressed comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D91979 Files: clang/docs/

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:742 "the argument to %0 has side effects that will be discarded">, - InGroup>; + InGroup; +def warn_assume_attribute_string_unknown : Warning< aaron.ballman wro

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 311070. jdoerfert added a comment. Remove accidental test change and ensure users create `KnownAssumptionString` objects Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D919

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 311060. jdoerfert added a comment. Move into LLVMCore and provide more helper to extracts assumptions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D91979 Files: clang/d

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 311010. jdoerfert added a comment. Herald added subscribers: llvm-commits, dexonsmith, hiraditya, mgorny. Herald added a project: LLVM. Allow to register assumption stings through llvm-core. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. Dropping the attribute and forcing the attribute to be somehow registered makes various use cases impossible. All we would allow is an integrated compilation where the consumers are available and the FE is aware of them. This is hard for optional LLVM plugins, potenti

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-10 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 310938. jdoerfert marked 8 inline comments as done. jdoerfert added a comment. Addressed remarks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D91979 Files: clang/docs/L

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D91979#2444327 , @jdoerfert wrote: > In D91979#2440554 , @aaron.ballman > wrote: > >> Thank you for your patience with the delays getting to your review! Along >> with the documen

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-09 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 310727. jdoerfert added a comment. minor spelling improvements Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D91979 Files: clang/docs/LanguageExtensions.rst clang/incl

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-09 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment. I added the warning and typo recognition as discussed in IRC. We list known assumption strings in the documentation and SemaDeclAttr. As we add new ones we should include a short description or link to their meaning. The ones I added so far are OpenMP specific (dubbed

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-09 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 310724. jdoerfert added a comment. List known assumptions and warn if unknown. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D91979 Files: clang/docs/LanguageExtensions.

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-12-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for your patience with the delays getting to your review! Along with the documentation question, one line of thinking I'm also not clear on is whether this should be a type-based attribute rather than a declaration-based attribute. For instance, if you w

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-11-23 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert updated this revision to Diff 307194. jdoerfert added a comment. Generalize check lines [NFC] Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm.org/D91979 Files: clang/docs/LanguageExtensions.rst clang/inc

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-11-23 Thread Thorsten via Phabricator via cfe-commits
tschuett added a comment. Swift uses a similar mechanism: https://github.com/apple/swift/blob/887464b7b67d5202bfa7adc4e3f045ff1027a5a7/stdlib/public/core/Array.swift#L829 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91979/new/ https://reviews.llvm

[PATCH] D91979: [Clang][Attr] Introduce the `assume` function attribute

2020-11-23 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert created this revision. jdoerfert added reviewers: JonChesterfield, aaron.ballman, jhuber6. Herald added a subscriber: bollu. Herald added a project: clang. jdoerfert requested review of this revision. Herald added a subscriber: sstefan1. The `assume` attribute is a way to provide additio