[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-31 Thread Mark de Wever via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Mordante marked an inline comment as done. Closed by commit rGb46fddf75fc2: [CodeGen] Implement [[likely]] and [[unlikely]] for while and for loop. (authored by Mordante). Changed prior to commit:

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-30 Thread Mark de Wever via Phabricator via cfe-commits
Mordante marked an inline comment as done. Mordante added a comment. Thanks for the review. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3161 + InGroup; +def note_attribute_has_no_effect_here : Note< + "annotating the %select{infinite loop}0 here">;

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-30 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 aside from a request about the note. Thank you for this! Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3161 + InGroup; +def

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-28 Thread Mark de Wever via Phabricator via cfe-commits
Mordante updated this revision to Diff 301332. Mordante marked an inline comment as done. Mordante added a comment. Addressed the review comments: - The likelhood attribute no longer affects the `do` statement. - Added a diagnotic when a likelihood attribute is used on an infinite while loop.

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:1866 + while(true) [[unlikely]] { +... // The attribute has no effect + } // Clang elides comparison and generates an infinite loop

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-27 Thread Mark de Wever via Phabricator via cfe-commits
Mordante marked 10 inline comments as done. Mordante added a comment. Thanks for the feedback. I'll update the patch after making the requested changes. Comment at: clang/include/clang/Basic/AttrDocs.td:1866 + while(true) [[unlikely]] { +... // The

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:1861 + + do [[unlikely]] { // The loop will always iterate once +... // The likelihood attribute affects the likelihood of the Mordante wrote: >

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-26 Thread Mark de Wever via Phabricator via cfe-commits
Mordante planned changes to this revision. Mordante marked 2 inline comments as done. Mordante added inline comments. Comment at: clang/include/clang/Basic/AttrDocs.td:1854 + for(int i = 0; i != size; ++i) [[likely]] { +... // The loop the likely path of

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for this! Comment at: clang/include/clang/Basic/AttrDocs.td:1773 -At the moment the attributes only have effect when used in an ``if``, ``else``, -or ``switch`` statement. +Below some usage examples likelihood attributes and their

[PATCH] D89899: [CodeGen] Implement [[likely]] and [[unlikely]] for the iteration statements

2020-10-21 Thread Mark de Wever via Phabricator via cfe-commits
Mordante created this revision. Mordante added reviewers: aaron.ballman, rjmccall, rsmith. Mordante added a project: clang. Herald added a subscriber: dexonsmith. Mordante requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D89899 Files: