[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,46 @@ +# Key Instructions in Clang + +Key Instructions is an LLVM feature that reduces the jumpiness of optimized code debug stepping. This document explains how Clang applies the necessary metadata. + +## Implementation + +See the [LLVM docs](../../llvm/docs/KeyInstr

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -63,6 +63,7 @@ intermediate LLVM representation. ResponseGuide Remarks RemoveDIsDebugInfo + KeyInstructions jmorse wrote: Is there a corresponding table-of-contents for clang too? https://github.com/llvm/llvm-project/pull/137991

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,114 @@ +# Key Instructions debug info in LLVM + +Key Instructions reduces the jumpiness of optimized code debug stepping. This document explains the feature and how it is implemented in LLVM. For Clang support please see the [Clang docs](../../clang/docs/KeyInstructio

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,46 @@ +# Key Instructions in Clang + +Key Instructions is an LLVM feature that reduces the jumpiness of optimized code debug stepping. This document explains how Clang applies the necessary metadata. + +## Implementation + +See the [LLVM docs](../../llvm/docs/KeyInstr

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,46 @@ +# Key Instructions in Clang + +Key Instructions is an LLVM feature that reduces the jumpiness of optimized code debug stepping. This document explains how Clang applies the necessary metadata. + +## Implementation + +See the [LLVM docs](../../llvm/docs/KeyInstr

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,46 @@ +# Key Instructions in Clang + +Key Instructions is an LLVM feature that reduces the jumpiness of optimized code debug stepping. This document explains how Clang applies the necessary metadata. + +## Implementation + +See the [LLVM docs](../../llvm/docs/KeyInstr

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: Various recommendations, but looking good. https://github.com/llvm/llvm-project/pull/137991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,46 @@ +# Key Instructions in Clang + +Key Instructions is an LLVM feature that reduces the jumpiness of optimized code debug stepping. This document explains how Clang applies the necessary metadata. jmorse wrote: This provides a negative reason (red

[clang] [llvm] [KeyInstr] Add docs (PR #137991)

2025-07-14 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/137991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr] Disable key-instructions for coroutine scopes (PR #147551)

2025-07-14 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse closed https://github.com/llvm/llvm-project/pull/147551 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstrs] Disable key-instructions for coroutine scopes (PR #147551)

2025-07-08 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse created https://github.com/llvm/llvm-project/pull/147551 At this time (immediately prior to llvm21 branching) we haven't instrumented coroutine generation to identify the "key" instructions of things like co_return and similar. This will lead to worse stepping behavio

[clang] [PS5][Driver] Fix bad negative check in ps5-linker.c test case (PR #147484)

2025-07-08 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/147484 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

2025-06-30 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/144346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

2025-06-30 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -gno-column-info -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s + +// g::h and i can be memcpy'd, check the assignment gets Key Instructions metadata. + +struct e { +

[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

2025-06-30 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/144346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (PR #144115)

2025-06-30 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM (my least favourite part of github, aside from it not being Phabricator, is that it chucks away all the inline comments randomly. Yay). Keeping on the HELP checklines though: if you symlink clang to `/bin/true` then with no checklines

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-27 Thread Jeremy Morse via cfe-commits
@@ -1904,7 +1904,8 @@ CGDebugInfo::createInlinedSubprogram(StringRef FuncName, /*ScopeLine=*/0, /*Flags=*/llvm::DINode::FlagArtificial, /*SPFlags=*/llvm::DISubprogram::SPFlagDefinition, -/*TParams=*/nullptr, /*ThrownTypes=*/nullptr, /*Annotations

[clang] [PS5][Driver] Allow selection of CRT with `-L` (PR #145869)

2025-06-27 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM with a question https://github.com/llvm/llvm-project/pull/145869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PS5][Driver] Allow selection of CRT with `-L` (PR #145869)

2025-06-27 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/145869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [PS5][Driver] Allow selection of CRT with `-L` (PR #145869)

2025-06-27 Thread Jeremy Morse via cfe-commits
@@ -200,12 +200,10 @@ // CHECK-NO-TARGETLIB-SAME: "-L." // RUN: mkdir -p %t.dir/myroot/target/lib -// RUN: touch %t.dir/myroot/target/lib/crti.o // RUN: env SCE_PROSPERO_SDK_DIR=%t.dir/myroot %clang --target=x64_64-sie-ps5 %s -### -Luser 2>&1 | FileCheck --check-prefixes=CHE

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-26 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. No strong opinion on the arguments really, thing can always be re-rationalised in the future. > Not sure I follow this question - can you elaborate? It's a draft fragment of one of the questions I asked that floated to the bottom, whoops.

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-26 Thread Jeremy Morse via cfe-commits
@@ -1904,7 +1904,8 @@ CGDebugInfo::createInlinedSubprogram(StringRef FuncName, /*ScopeLine=*/0, /*Flags=*/llvm::DINode::FlagArtificial, /*SPFlags=*/llvm::DISubprogram::SPFlagDefinition, -/*TParams=*/nullptr, /*ThrownTypes=*/nullptr, /*Annotations

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-26 Thread Jeremy Morse via cfe-commits
@@ -922,8 +922,8 @@ template <> struct MDNodeKeyImpl { MDString *LinkageName; Metadata *File; unsigned Line; - Metadata *Type; unsigned ScopeLine; + Metadata *Type; jmorse wrote: SGTM https://github.com/llvm/llvm-project/pull/144107 ___

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-26 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/144107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (PR #144115)

2025-06-26 Thread Jeremy Morse via cfe-commits
@@ -8,8 +8,14 @@ // HELP-NOT: key-instructions // KEY-INSTRUCTIONS: "-gkey-instructions" -// KEY-INSTRUCTIONS: "-mllvm" "-dwarf-use-key-instructions" // NO-KEY-INSTRUCTIONS-NOT: key-instructions - TODO: Add smoke test once some functionality has been added. +// RUN %c

[clang] [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (PR #144115)

2025-06-26 Thread Jeremy Morse via cfe-commits
@@ -8,8 +8,14 @@ // HELP-NOT: key-instructions jmorse wrote: Not an issue with this patch but, with no positive HELP: prefixes, this check passes vacuously. https://github.com/llvm/llvm-project/pull/144115 ___ cfe-

[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

2025-06-26 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,59 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions %s -gno-column-info -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s + +// g::h and i can be memcpy'd, check the assignment gets Key Instructions metadata. + +struct e { +

[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

2025-06-26 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: >From the context, it feels like clang is going to try turning groups of >initializers into memcpys, is that right? If so, does that affect the desired >stepping behaviour, i.e. would multiple assignments be grouped into one >memcpy? I suppose it's not majo

[clang] [KeyInstr][Clang] Copy ctor/assignment operator source atoms (PR #144346)

2025-06-26 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/144346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Atomic ops atoms (PR #141624)

2025-06-24 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,162 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c++ -std=c++17 %s -debug-info-kind=line-tables-only -emit-llvm -o - -gno-column-info \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank +// RUN: %clang_cc1 -

[clang] [KeyInstr][Clang] Atomic ops atoms (PR #141624)

2025-06-24 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,162 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c++ -std=c++17 %s -debug-info-kind=line-tables-only -emit-llvm -o - -gno-column-info \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank +// RUN: %clang_cc1 -

[clang] [KeyInstr][Clang] Atomic ops atoms (PR #141624)

2025-06-24 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM, with a test question https://github.com/llvm/llvm-project/pull/141624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Atomic ops atoms (PR #141624)

2025-06-24 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/141624 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
@@ -1904,7 +1904,8 @@ CGDebugInfo::createInlinedSubprogram(StringRef FuncName, /*ScopeLine=*/0, /*Flags=*/llvm::DINode::FlagArtificial, /*SPFlags=*/llvm::DISubprogram::SPFlagDefinition, -/*TParams=*/nullptr, /*ThrownTypes=*/nullptr, /*Annotations

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM, I think this raises a few questions about whether we're going to support non-key-instructions code forever more. AFAIUI the premise is that the debugging behaviour is worse if you've got groupless instructions in a key-instructions pr

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/144107 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [KeyInstr] Add DISubprogram::keyInstructions bit (PR #144107)

2025-06-23 Thread Jeremy Morse via cfe-commits
@@ -922,8 +922,8 @@ template <> struct MDNodeKeyImpl { MDString *LinkageName; Metadata *File; unsigned Line; - Metadata *Type; unsigned ScopeLine; + Metadata *Type; jmorse wrote: This is space packing rather than being related to a functional change

[clang] [libc] [llvm] [DebugInfo][RemoveDIs] Suppress getNextNonDebugInfoInstruction (PR #144383)

2025-06-16 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse created https://github.com/llvm/llvm-project/pull/144383 There are no longer debug-info instructions, thus we don't need this skipping. Horray! CC @WenleiHe , `getNextNonDebugInfoInstruction` has a "skip pseudo-probes" argument that appears to be unused throughout al

[clang] [flang] [llvm] [mlir] [DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag (PR #143207)

2025-06-09 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse closed https://github.com/llvm/llvm-project/pull/143207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [llvm] [mlir] [DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag (PR #143207)

2025-06-09 Thread Jeremy Morse via cfe-commits
jmorse wrote: Removing the `--experimental-debuginfo-iterators` flag from 1 flang and 1 mlir test too -- the flag has been a dummy for a month and doesn't do anything, the extra RUNlines were just extra coverage for when intrinsic support was still feasible. https://github.com/llvm/llvm-proje

[clang] [flang] [llvm] [mlir] [DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag (PR #143207)

2025-06-09 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse updated https://github.com/llvm/llvm-project/pull/143207 >From b0cf784e2bf0b7c42f5365907dc94353676ae8fc Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Thu, 15 May 2025 14:10:58 +0100 Subject: [PATCH 1/7] [DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag

[clang] [llvm] [mlir] [DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag (PR #143207)

2025-06-09 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse updated https://github.com/llvm/llvm-project/pull/143207 >From b0cf784e2bf0b7c42f5365907dc94353676ae8fc Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Thu, 15 May 2025 14:10:58 +0100 Subject: [PATCH 1/6] [DebugInfo][RemoveDIs] Rip out the UseNewDbgInfoFormat flag

[clang] [llvm] [DebugInfo] Place local ODR-uniqued types in decl DISubprograms (PR #142166)

2025-06-09 Thread Jeremy Morse via cfe-commits
jmorse wrote: (Transparency, I wrote some of the code in the PR so dunno if I should review it,) > I /think/ function-local types need to go in definitions - in /abstract/ > definitions if they exist (not in the inlined instances or concrete out of > line instances). I think this highlights

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-06-06 Thread Jeremy Morse via cfe-commits
jmorse wrote: Interesting -- I suppose the new variable recording where vtables are count as a source-variable, and in some circumstances the vtable address must be optimised away? (Whole program devirtualisation for example). I'd suggest that this isn't a concerning reduction in coverage (bec

[clang] [KeyInstr][Clang] Ret atom (PR #134652)

2025-06-04 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/134652 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][KeyInstr][Clang] Add some additional tests (PR #134654)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM with a nit https://github.com/llvm/llvm-project/pull/134654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][KeyInstr][Clang] Add some additional tests (PR #134654)

2025-06-03 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank + +// RUN: %clang_cc1 -triple x86

[clang] [KeyInstr][Clang] Ret atom (PR #134652)

2025-06-03 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,101 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-CXX + +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructi

[clang] [KeyInstr][Clang] Ret atom (PR #134652)

2025-06-03 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -gno-column-info -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank + +// RUN: %clang_cc1 -triple x86_

[clang] [KeyInstr][Clang] Ret atom (PR #134652)

2025-06-03 Thread Jeremy Morse via cfe-commits
@@ -1118,6 +1118,8 @@ void CodeGenFunction::EmitBranchThroughCleanup(JumpDest Dest) { // Create the branch. llvm::BranchInst *BI = Builder.CreateBr(Dest.getBlock()); + // This is the primary instruction for this atom, acting in place of a ret. jmorse wro

[clang] [KeyInstr][Clang] Ret atom (PR #134652)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/134652 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Ret atom (PR #134652)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: If I understand correctly, most of the test changes are to ensure that return instructions get /an/ atom group, without being specific about which? IMO it'd be better to make that number explicit to avoid a return accidentally being part of the _wrong_ atom

[clang] [NFC][KeyInstr][Clang] Add some additional tests (PR #134654)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/134654 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. Continues to LGTM https://github.com/llvm/llvm-project/pull/134646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-06-03 Thread Jeremy Morse via cfe-commits
@@ -1418,6 +1427,12 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S, if (CGM.shouldEmitConvergenceTokens()) ConvergenceTokenStack.pop_back(); + + if (FinalBodyBB) { +// Key Instructions: We want the for closing brace to be step-able on to +// match existin

[clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/134646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-06-03 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM, with a nit/question inline https://github.com/llvm/llvm-project/pull/134646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][DebugInfo][clang] Finalize all declaration subprograms in DIBuilder::finalize() (PR #139914)

2025-06-02 Thread Jeremy Morse via cfe-commits
jmorse wrote: > Performance cost in terms of compilation time? Compilation time indeed -- there's a small chance that we unexpectedly start producing masses of useless type information, which would mean we'd have to rethink this. It'll show up on https://llvm-compile-time-tracker.com/ pretty

[clang] [llvm] [llvm][DebugInfo][clang] Finalize all declaration subprograms in DIBuilder::finalize() (PR #139914)

2025-06-02 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. > It seems to me that manual finalizeSubprogram() calls were added > sporadically, not by following declaration-vs-definition logic. > With the call added [and with #119001], the test output changes: declaration > DISubprograms have their D

[clang] [KeyInstr][Clang] Catch variable init atom (PR #134641)

2025-05-23 Thread Jeremy Morse via cfe-commits
@@ -5055,6 +5055,7 @@ void ItaniumCXXABI::emitBeginCatch(CodeGenFunction &CGF, // Emit the local. CodeGenFunction::AutoVarEmission var = CGF.EmitAutoVarAlloca(*CatchParam); + ApplyAtomGroup Grp(CGF.getDebugInfo()); InitCatchParam(CGF, *CatchParam, var.getObjectAddress(

[clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

2025-05-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/134643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

2025-05-23 Thread Jeremy Morse via cfe-commits
@@ -0,0 +1,51 @@ +// RUN: %clang_cc1 -gkey-instructions -x c++ -std=c++17 %s -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank --check-prefixes=CHECK,CHECK-CXX + +// RUN: %clang_cc1 -gkey-inst

[clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

2025-05-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/134643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Catch variable init atom (PR #134641)

2025-05-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. (LGTM with the braces) https://github.com/llvm/llvm-project/pull/134641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr] Complex assignment atoms (PR #134638)

2025-05-23 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/134638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [KeyInstr][Clang] Add ApplyAtomGroup (PR #134632)

2025-05-21 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. Much clearer, LGTM thanks! https://github.com/llvm/llvm-project/pull/134632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][DebugInfo][clang] Finalize all declaration subprograms in DIBuilder::finalize() (PR #139914)

2025-05-21 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: I suppose what this is encoding is a (subtle?) assumption about how definition-subprograms are modelled: they're created once and are immutable. Wheras declaration-functions can be forwarded declared and then have extra information added to them when a def

[clang] [KeyInstr][Clang] Add Clang option -g[no-]key-instructions (PR #134627)

2025-05-19 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM then, in practice we always get bitten by commandlines + LTO sooner or later, so I'm confident we'll end up doing-the-right-thing anyway after breaking our internal CI a few times. https://github.com/llvm/llvm-project/pull/134627 _

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-05-13 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: On the whole this looks fine to me with a final nit https://github.com/llvm/llvm-project/pull/130255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-05-13 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/130255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-05-13 Thread Jeremy Morse via cfe-commits
@@ -1816,6 +1816,15 @@ class CodeGenModule : public CodeGenTypeCache { void requireVectorDestructorDefinition(const CXXRecordDecl *RD); bool classNeedsVectorDestructor(const CXXRecordDecl *RD); + // Helper to get the alignment for a variable. + unsigned getGlobalVarAlign

[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

2025-05-13 Thread Jeremy Morse via cfe-commits
jmorse wrote: It sounds like there's agreement that the "before" approach was better/acceptable, i.e. having a CU-level variable that refers by `DW_AT_specification` to a variable in the class type. Doing so would also avoid the customisation for vtable-addresses in the latest patch with the

[clang] [llvm] [NFC] Replace more DenseMaps with SmallDenseMaps (PR #111836)

2025-05-06 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse closed https://github.com/llvm/llvm-project/pull/111836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Replace more DenseMaps with SmallDenseMaps (PR #111836)

2025-05-06 Thread Jeremy Morse via cfe-commits
jmorse wrote: /me squints -- this was a minor improvement and I've lost all the context behind it, abandoning as it's not worth revisiting IMO https://github.com/llvm/llvm-project/pull/111836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[clang] [Clang][CodeGen][X86] don't coerce int128 into `{i64,i64}` for SysV-like ABIs (PR #135230)

2025-04-23 Thread Jeremy Morse via cfe-commits
jmorse wrote: > To solve this problem in general, it would probably(?) be best to make SROA > create fragment #dbg_value records if it decomposes an alloca into multiple > IR values but I have no idea how difficult that would be to accomplish. An example of this happening today with C++ struct

[clang] [Clang][CodeGen][X86] don't coerce int128 into `{i64,i64}` for SysV-like ABIs (PR #135230)

2025-04-11 Thread Jeremy Morse via cfe-commits
jmorse wrote: There's precedent for splitting the debug-info into fragments early, we do something similar for C++ structured-bindings in SROA and a very similar process happens when the i128 argument is split up in instruction-selection. Split-up locations become brittle to optimisations thou

[clang] [llvm] [reland][DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126967)

2025-02-13 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/126967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-12 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM too; thanks for running with this! https://github.com/llvm/llvm-project/pull/126059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-07 Thread Jeremy Morse via cfe-commits
@@ -1708,19 +1706,9 @@ static void insertDbgValueOrDbgVariableRecord(DIBuilder &Builder, Value *DV, static void insertDbgValueOrDbgVariableRecordAfter( DIBuilder &Builder, Value *DV, DILocalVariable *DIVar, DIExpression *DIExpr, -const DebugLoc &NewLoc, BasicBlock::i

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-07 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/126059 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DebugInfo] Update DIBuilder insertion to take InsertPosition (PR #126059)

2025-02-07 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: This looks great, thanks for putting this all together, one nit inline, Is this intended to be cherry-picked into the release branch or not? Seeing how the original motivation was to ease downstream compatibilities, I'd assumed there'd be the need for somet

[clang] [llvm] [Clang] Cleanup docs and comments relating to -fextend-variable-liveness (PR #124767)

2025-01-28 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse approved this pull request. LGTM on the belief that `-fextend-this-ptr-liveness` hasn't been in the driver for very long at all -- if that isn't the case, we end up having to ask questions about supporting it. https://github.com/llvm/llvm-project/pull/124767 _

[clang] [llvm] [NFC][DebugInfo] Rewrite more call-sites to insert with iterators (PR #124288)

2025-01-27 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse closed https://github.com/llvm/llvm-project/pull/124288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][DebugInfo] Rewrite more call-sites to insert with iterators (PR #124288)

2025-01-27 Thread Jeremy Morse via cfe-commits
jmorse wrote: Merged in 285009f202ca as it was composing with a workaround in an earlier commit. https://github.com/llvm/llvm-project/pull/124288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] 285009f - [NFC][DebugInfo] Rewrite more call-sites to insert with iterators (#124288)

2025-01-27 Thread Jeremy Morse via cfe-commits
Author: Jeremy Morse Date: 2025-01-27T20:30:45Z New Revision: 285009f202ca8bfcc6b607eba0e919867559e725 URL: https://github.com/llvm/llvm-project/commit/285009f202ca8bfcc6b607eba0e919867559e725 DIFF: https://github.com/llvm/llvm-project/commit/285009f202ca8bfcc6b607eba0e919867559e725.diff LOG:

[clang] [llvm] [NFC][DebugInfo] Rewrite more call-sites to insert with iterators (PR #124288)

2025-01-27 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse updated https://github.com/llvm/llvm-project/pull/124288 >From b60342427447c46d646d3de5b91fcbdbcb8585d3 Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Thu, 23 Jan 2025 17:06:04 + Subject: [PATCH 1/2] [NFC][DebugInfo] Rewrite more call-sites to insert with itera

[clang] [llvm] [NFC][DebugInfo] Rewrite more call-sites to insert with iterators (PR #124288)

2025-01-27 Thread Jeremy Morse via cfe-commits
@@ -823,7 +823,16 @@ static void updateScopeLine(Instruction *ActiveSuspend, if (!ActiveSuspend) return; - auto *Successor = ActiveSuspend->getNextNonDebugInstruction(); + // No subsequent instruction -> fallback to the location of ActiveSuspend. + if (!ActiveSuspend-

[clang] [llvm] [NFC][DebugInfo] Use iterators for instruction insertion in more places (PR #124291)

2025-01-27 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse closed https://github.com/llvm/llvm-project/pull/124291 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][DebugInfo] Use iterators for instruction insertion in more places (PR #124291)

2025-01-27 Thread Jeremy Morse via cfe-commits
jmorse wrote: Ta; fixed some of the clang-format errors that are on lines that I've touched, however I'm leaving the clang-format errors that are adjacent (there are some pre-existing indentation issues too it seems). https://github.com/llvm/llvm-project/pull/124291 ___

[clang] [llvm] [NFC][DebugInfo] Use iterators for instruction insertion in more places (PR #124291)

2025-01-27 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse updated https://github.com/llvm/llvm-project/pull/124291 >From 8bafca72573c7ba5e7b7711c5168e0609571661f Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Thu, 23 Jan 2025 14:18:55 + Subject: [PATCH 1/2] [NFC][DebugInfo] Use iterators for instruction insertion in m

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-24 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse commented: This looks good, but I'd like to reword some of it https://github.com/llvm/llvm-project/pull/118026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-24 Thread Jeremy Morse via cfe-commits
@@ -412,6 +412,20 @@ New Compiler Flags only for thread-local variables, and none (which corresponds to the existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-fextend-variable-liveness`` flag has been added to allow for imp

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-24 Thread Jeremy Morse via cfe-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/118026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Enable -fextend-lifetimes at -Og (PR #118026)

2025-01-24 Thread Jeremy Morse via cfe-commits
@@ -4298,6 +4298,26 @@ def stack_usage_file : Separate<["-"], "stack-usage-file">, Visibility<[CC1Option]>, HelpText<"Filename (or -) to write stack usage output to">, MarshallingInfoString>; +def fextend_variable_liveness_EQ : Joined<["-"], "fextend-variable-liveness=">

  1   2   3   >