Skip to content

[KeyInstr][Clang] For stmt atom #134646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 3, 2025
Merged

[KeyInstr][Clang] For stmt atom #134646

merged 9 commits into from
Jun 3, 2025

Conversation

OCHyams
Copy link
Contributor

@OCHyams OCHyams commented Apr 7, 2025

This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

The Key Instructions project is introduced, including a "quick summary" section
at the top which adds context for this PR, here:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.

The Clang-side work is demoed here:
#130943

This was referenced Apr 7, 2025
@OCHyams OCHyams force-pushed the users/OCHyams/ki-clang-while branch from cdd6ff3 to 8b75d7f Compare May 23, 2025 13:32
Base automatically changed from users/OCHyams/ki-clang-while to main May 23, 2025 13:42
@OCHyams OCHyams marked this pull request as draft May 23, 2025 13:43
@OCHyams OCHyams force-pushed the users/OCHyams/ki-clang-for branch from 2317236 to 74a6ebd Compare May 23, 2025 13:43
@OCHyams OCHyams marked this pull request as ready for review May 23, 2025 13:43
@OCHyams OCHyams force-pushed the users/OCHyams/ki-clang-for branch from 74a6ebd to b41dc1c Compare May 27, 2025 14:28
@OCHyams
Copy link
Contributor Author

OCHyams commented May 27, 2025

You were right about any ctrl-flow breaking the br-to-cond atom group. Fixed, improved testing, and follow up with additional work for continue/break in #141618

n.b. this is now based on top of #141607 so please ignore the first commit (sorry, the graphite stack has completely toppled and we're back into GitHub freeform stacking nastiness) (Merged that and rebased the PR, so all commits are fair game for review).

OCHyams added 7 commits May 28, 2025 11:27
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

The Key Instructions project is introduced, including a "quick summary" section
at the top which adds context for this PR, here:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.

The Clang-side work is demoed here:
#130943
@OCHyams OCHyams force-pushed the users/OCHyams/ki-clang-for branch from 784005e to 0af9ceb Compare May 28, 2025 10:56
Copy link
Member

@jmorse jmorse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with a nit/question inline

Comment on lines +1432 to +1433
// Key Instructions: We want the for closing brace to be step-able on to
// match existing behaviour.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the comment should indicate the intention of what FinalBodyBB -- presumably the last block of the body where the scope ends. Does this mean that for brace-less for loops, we could theoretically step on the same last-line twice if there's a simple assignment and then a branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that for brace-less for loops, we could theoretically step on the same last-line twice if there's a simple assignment and then a branch?

There could be two is_stmts there for the same line, yep (I think we discussed before that interpreting that is up to the debugger).

Added to test for additional coverage.

Updated comment.

Copy link
Member

@jmorse jmorse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continues to LGTM

@OCHyams OCHyams merged commit 0555594 into main Jun 3, 2025
11 checks passed
@OCHyams OCHyams deleted the users/OCHyams/ki-clang-for branch June 3, 2025 12:47
OCHyams added a commit that referenced this pull request Jun 3, 2025
[KeyInstr][Clang] For stmt atom (#134646)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
OCHyams added a commit that referenced this pull request Jun 3, 2025
[KeyInstr][Clang] For stmt atom (#134646)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
[KeyInstr][Clang] For stmt atom (llvm#134646)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
[KeyInstr][Clang] For stmt atom (llvm#134646)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
[KeyInstr][Clang] For stmt atom (llvm#134646)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
[KeyInstr][Clang] For stmt atom (llvm#134646)
This patch is part of a stack that teaches Clang to generate Key Instructions
metadata for C and C++.

RFC:
https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668

The feature is only functional in LLVM if LLVM is built with CMake flag
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONs. Eventually that flag will be removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants