[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D144334#4142462 , @Izaron wrote: > In D144334#4141646 , @erichkeane > wrote: > >> I'm on the fence as to whether we want to implement this feature at all. As >> was discussed e

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/CodeGen/CGStmt.cpp:723-727 +case attr::Assume: { + llvm::Value *ArgValue = EmitScalarExpr(cast(A)->getCond()); + llvm::Function *FnAssume = CGM.getIntrinsic(llvm::Intrinsic::assume); + Builder.CreateCall(F

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron marked an inline comment as done. Izaron added a comment. In D144334#4142490 , @erichkeane wrote: > Just deliberately not support a part of C++2b. Implementers have veto'ed > features in the past exactly that way. That's sad. Let's at least wri

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. In D144334#4142462 , @Izaron wrote: > In D144334#4141646 , @erichkeane > wrote: > >> I'm on the fence as to whether we want to implement this feature at all. As >> was discussed exte

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D144334#4141646 , @erichkeane wrote: > I'm on the fence as to whether we want to implement this feature at all. As > was discussed extensively during the EWG meetings on this: multiple > implementers are against this attribu

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1448 +def Assume : StmtAttr { + let Spellings = [CXX11<"", "assume", 202302>]; + let Documentation = [AssumeDocs]; tahonermann wrote: > philnik wrote: > > Izaron wrote: > > > Honestly

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1448 +def Assume : StmtAttr { + let Spellings = [CXX11<"", "assume", 202302>]; + let Documentation = [AssumeDocs]; philnik wrote: > Izaron wrote: > > Honestly I don't have a clue w

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-21 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. So one thing to note here: I'm on the fence as to whether we want to implement this feature at all. As was discussed extensively during the EWG meetings on this: multiple implementers are against this attribute for a variety of reasons, and at least 1 other implemen

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-20 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added inline comments. Comment at: clang/lib/CodeGen/CGStmt.cpp:723-727 +case attr::Assume: { + llvm::Value *ArgValue = EmitScalarExpr(cast(A)->getCond()); + llvm::Function *FnAssume = CGM.getIntrinsic(llvm::Intrinsic::assume); + Builder.CreateCall(FnA

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-20 Thread Corentin Jabot via Phabricator via cfe-commits
cor3ntin added a comment. Can you add a test to check `__has_cpp_attribute(assume)` ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144334/new/ https://reviews.llvm.org/D144334 ___ cfe-commits mailing li

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-20 Thread Nikita Popov via Phabricator via cfe-commits
nikic resigned from this revision. nikic added a comment. (not a clang reviewer) Comment at: clang/test/CodeGenCXX/cxx2b-assume.cpp:55 +// CHECK-OPT-NEXT: tail call void @llvm.assume(i1 %[[CMP]]) +// CHECK-OPT-NEXT: ret i32 43 +// Isn't the assume expressio

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. If you are not familiar with the `[[assume(expr]]` concept and want to know more, I wrote a small article about it recently, with a lot of additional links (including to the author of the proposal) - https://izaron.github.io/posts/assume/ Repository: rG LLVM Github M

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 498625. Izaron added a comment. More thorough AST test. Set the right macros number - thanks to @philnik! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144334/new/ https://reviews.llvm.org/D144334 Files: cla

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Nikolas Klauser via Phabricator via cfe-commits
philnik added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1448 +def Assume : StmtAttr { + let Spellings = [CXX11<"", "assume", 202302>]; + let Documentation = [AssumeDocs]; Izaron wrote: > Honestly I don't have a clue what these numbers `2023

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1448 +def Assume : StmtAttr { + let Spellings = [CXX11<"", "assume", 202302>]; + let Documentation = [AssumeDocs]; Honestly I don't have a clue what these numbers `202302` (apparently t

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 498622. Izaron added a comment. A small fix for `def FutureAttrs` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144334/new/ https://reviews.llvm.org/D144334 Files: clang/docs/ReleaseNotes.rst clang/include/

[PATCH] D144334: [Clang] Add C++2b attribute [[assume(expression)]]

2023-02-18 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: clang-language-wg, aaron.ballman, rsmith, nikic. Herald added a subscriber: StephenFan. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Clang already