[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Add debugify support (PR #143594)

2025-07-03 Thread Jeremy Morse via llvm-branch-commits
@@ -59,6 +65,52 @@ cl::opt DebugifyLevel( raw_ostream &dbg() { return Quiet ? nulls() : errs(); } +#if LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN +// These maps refer to addresses in this instance of LLVM, so we can reuse them +// everywhere - therefore, we store them at file scope

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Add debugify support (PR #143594)

2025-07-03 Thread Jeremy Morse via llvm-branch-commits
@@ -59,6 +65,52 @@ cl::opt DebugifyLevel( raw_ostream &dbg() { return Quiet ? nulls() : errs(); } +#if LLVM_ENABLE_DEBUGLOC_TRACKING_ORIGIN +// These maps refer to addresses in this instance of LLVM, so we can reuse them +// everywhere - therefore, we store them at file scope

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Add debugify support (PR #143594)

2025-07-03 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Tentative LGTM, noting that you're planning on updating docs in this PR too. I've no familiarity with the python modified alas. https://github.com/llvm/llvm-project/pull/143594 ___ llvm-branch-commits mailing list

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Add debugify support (PR #143594)

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

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Collect stack traces in DebugLoc (PR #143592)

2025-06-16 Thread Jeremy Morse via llvm-branch-commits
@@ -27,6 +27,21 @@ namespace llvm { class Function; #if LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING + struct DbgLocOrigin { +static constexpr unsigned long MaxDepth = 16; +using StackTracesTy = +SmallVector>, 0>;

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Collect stack traces in DebugLoc (PR #143592)

2025-06-16 Thread Jeremy Morse via llvm-branch-commits
@@ -9,11 +9,31 @@ #include "llvm/IR/DebugLoc.h" #include "llvm/Config/llvm-config.h" #include "llvm/IR/DebugInfo.h" + +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING +#include "llvm/Support/Signals.h" + +namespace llvm { +DbgLocOrigin::DbgLocOrigin(bool ShouldCollectTrace) { + if (S

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Collect stack traces in DebugLoc (PR #143592)

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

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Collect stack traces in DebugLoc (PR #143592)

2025-06-16 Thread Jeremy Morse via llvm-branch-commits
@@ -55,22 +70,29 @@ namespace llvm { Temporary }; - // Extends TrackingMDNodeRef to also store a DebugLocKind, allowing Debugify - // to ignore intentionally-empty DebugLocs. - class DILocAndCoverageTracking : public TrackingMDNodeRef { + // Extends TrackingMDNodeRef

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Collect stack traces in DebugLoc (PR #143592)

2025-06-16 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Looking good with some questions https://github.com/llvm/llvm-project/pull/143592 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-c

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddres

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

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

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddres

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
@@ -507,6 +507,21 @@ static int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *arg) { return 0; } +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING +#if !defined(HAVE_BACKTRACE) +#error DebugLoc origin-tracking currently requires `backtrace()`. +#endif j

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
@@ -57,6 +75,28 @@ LLVM_ABI void DisableSystemDialogsOnCrash(); ///specified, the entire frame is printed. LLVM_ABI void PrintStackTrace(raw_ostream &OS, int Depth = 0); +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING +#ifdef NDEBUG +#error DebugLoc origin-tracking should no

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Knarly but necessary I suppose. If there is indeed a way of reducing duplication that'd be fab. A bigger question though is whether this can be tested. That would have the benefit of keeping this working across a range of platforms, and then the functional

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if LLVM_ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddres

[llvm-branch-commits] [llvm] [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (PR #143591)

2025-06-11 Thread Jeremy Morse via llvm-branch-commits
@@ -14,14 +14,32 @@ #ifndef LLVM_SUPPORT_SIGNALS_H #define LLVM_SUPPORT_SIGNALS_H +#include "llvm/Config/llvm-config.h" #include "llvm/Support/Compiler.h" +#include #include #include namespace llvm { class StringRef; class raw_ostream; +#if LLVM_ENABLE_DEBUGLOC_OR

[llvm-branch-commits] [clang] [KeyInstr][Clang] Break and Continue stmt atoms (PR #141618)

2025-06-03 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM, this all makes sense (to make break/continue their own key instructions). This involves cleanup scopes getting their own group: will destructors that run when "break"ing out of a loop get the key-ness of the "break" statement? (This m

[llvm-branch-commits] [clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -1416,6 +1424,12 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S, if (CGM.shouldEmitConvergenceTokens()) ConvergenceTokenStack.pop_back(); + + if (ForBody) { +// Key Instructions: We want the for closing brace to be step-able on to +// match existing be

[llvm-branch-commits] [clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,37 @@ +// RUN: %clang_cc1 -gkey-instructions -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 -gkey-instructions -x c %s -debug-info-kind=line-tabl

[llvm-branch-commits] [clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Question inline https://github.com/llvm/llvm-project/pull/134646 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [KeyInstr][Clang] For stmt atom (PR #134646)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -1362,7 +1363,14 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S, BoolCondVal = emitCondLikelihoodViaExpectIntrinsic( BoolCondVal, Stmt::getLikelihood(S.getBody())); -Builder.CreateCondBr(BoolCondVal, ForBody, ExitBlock, Weights); +auto *I = Bu

[llvm-branch-commits] [clang] [KeyInstr][Clang] For stmt atom (PR #134646)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] While stmt atom (PR #134645)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM with nits https://github.com/llvm/llvm-project/pull/134645 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-co

[llvm-branch-commits] [clang] [KeyInstr][Clang] While stmt atom (PR #134645)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] While stmt atom (PR #134645)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,34 @@ +// 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 + +// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kin

[llvm-branch-commits] [clang] [KeyInstr][Clang] While stmt atom (PR #134645)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,34 @@ +// 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 + +// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kin

[llvm-branch-commits] [clang] [KeyInstr][Clang] While stmt atom (PR #134645)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -1130,7 +1130,14 @@ void CodeGenFunction::EmitWhileStmt(const WhileStmt &S, if (!Weights && CGM.getCodeGenOpts().OptimizationLevel) BoolCondVal = emitCondLikelihoodViaExpectIntrinsic( BoolCondVal, Stmt::getLikelihood(S.getBody())); -Builder.CreateCond

[llvm-branch-commits] [clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -1242,9 +1242,17 @@ void CodeGenFunction::EmitDoStmt(const DoStmt &S, // As long as the condition is true, iterate the loop. if (EmitBoolCondBranch) { uint64_t BackedgeCount = getProfileCount(S.getBody()) - ParentCount; -Builder.CreateCondBr( +auto *I = Build

[llvm-branch-commits] [clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM with some nits to address. https://github.com/llvm/llvm-project/pull/134644 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[llvm-branch-commits] [clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -1242,9 +1242,17 @@ void CodeGenFunction::EmitDoStmt(const DoStmt &S, // As long as the condition is true, iterate the loop. if (EmitBoolCondBranch) { uint64_t BackedgeCount = getProfileCount(S.getBody()) - ParentCount; -Builder.CreateCondBr( +auto *I = Build

[llvm-branch-commits] [clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,33 @@ +// 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 + +// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kin

[llvm-branch-commits] [clang] [KeyInstr][Clang] Do stmt atom (PR #134644)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,33 @@ +// 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 + +// RUN: %clang_cc1 -gkey-instructions -x c %s -debug-info-kin

[llvm-branch-commits] [clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

2025-05-22 Thread Jeremy Morse via llvm-branch-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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

2025-05-22 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM with some test nits, please do disagree with those https://github.com/llvm/llvm-project/pull/134643 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.or

[llvm-branch-commits] [clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

2025-05-22 Thread Jeremy Morse via llvm-branch-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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Switch stmt atom (PR #134643)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] If stmt atom (PR #134642)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Member initalization atom (PR #134640)

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

[llvm-branch-commits] [clang] [KeyInstr] Complex assignment atoms (PR #134638)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Looks good overall but I have some minor comments about symmetry with other patches https://github.com/llvm/llvm-project/pull/134638 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://l

[llvm-branch-commits] [clang] [KeyInstr][Clang] Aggregate init + copy (PR #134639)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -1,14 +1,16 @@ -// RUN: %clang -gkey-instructions -x c++ %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \ +// RUN: %clang_cc1 -gkey-instructions -x c++ %s -debug-info-kind=line-tables-only -gno-column-info -emit-llvm -o - -ftrivial-auto-var-in

[llvm-branch-commits] [clang] [KeyInstr][Clang] Aggregate init + copy (PR #134639)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Aggregate init + copy (PR #134639)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM, but with extra spurious stuff in an unrelated test file? https://github.com/llvm/llvm-project/pull/134639 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.

[llvm-branch-commits] [clang] [KeyInstr] Complex assignment atoms (PR #134638)

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

[llvm-branch-commits] [clang] [KeyInstr] Complex assignment atoms (PR #134638)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -1356,6 +1361,7 @@ LValue ComplexExprEmitter::EmitBinAssignLValue(const BinaryOperator *E, } ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) { + ApplyAtomGroup Grp(CGF.getDebugInfo()); ComplexPairTy Val; LValue LV = EmitBinAssignLValue(E, V

[llvm-branch-commits] [clang] [KeyInstr] Complex assignment atoms (PR #134638)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -1209,6 +1213,7 @@ LValue ComplexExprEmitter:: EmitCompoundAssignLValue(const CompoundAssignOperator *E, ComplexPairTy (ComplexExprEmitter::*Func)(const BinOpInfo&), RValue &Val) { + ApplyAtomGroup Grp(CGF.getDebugInfo());

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -gkey-instructions -x c++ %s -debug-info-kind=line-tables-only -emit-llvm -o - \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank jmorse wrote: This test is great; I feel we can make it ev

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -5985,6 +5985,15 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { jmorse wrote: I wonder whether the comma operator (six or seven lines above here) needs instrumenting -- technically if either lhs/rhs of the comma is an assign

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -5985,6 +5985,15 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { assert(E->getOpcode() == BO_Assign && "unexpected binary l-value"); + // This covers both LHS and RHS expressions, though nested RHS + // expressions may get subsequently s

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -5849,6 +5852,7 @@ LValue CodeGenFunction::EmitObjCIsaExpr(const ObjCIsaExpr *E) { LValue CodeGenFunction::EmitCompoundAssignmentLValue( const CompoundAssignOperator *E) { + ApplyAtomGroup Grp(getDebugInfo()); j

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,41 @@ + +// RUN: %clang -gkey-instructions -x c++ %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank + +// RUN: %clang -gkey-instructions -x c %s -gmlt -gn

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -gkey-instructions -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 -gkey-instructions -x c %s -debug-info-kind=line-tabl

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,41 @@ + +// RUN: %clang -gkey-instructions -x c++ %s -gmlt -gno-column-info -S -emit-llvm -o - -ftrivial-auto-var-init=pattern \ +// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank + +// RUN: %clang -gkey-instructions -x c %s -gmlt -gn

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
@@ -5985,6 +5985,15 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *E) { assert(E->getOpcode() == BO_Assign && "unexpected binary l-value"); + // This covers both LHS and RHS expressions, though nested RHS + // expressions may get subsequently s

[llvm-branch-commits] [clang] [KeyInstr][Clang] Assignment atom group (PR #134637)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Looks good, with a question inline and some test nits. https://github.com/llvm/llvm-project/pull/134637 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[llvm-branch-commits] [clang] [KeyInstr][Clang] Agg init atom (PR #134635)

2025-05-21 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM (horray for graphite cc'ing everyone) https://github.com/llvm/llvm-project/pull/134635 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[llvm-branch-commits] [clang] [KeyInstr][Clang] Scalar init atom (PR #134633)

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

[llvm-branch-commits] [clang] [KeyInstr][Clang] Add ApplyAtomGroup (PR #134632)

2025-05-13 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. This all seems fine -- I guess the plumbing here has to get in without a test, before then later real changes come in and can be tested. The "Override" vs new-source-atom distinction seems a little clunky, although I haven't read how it's u

[llvm-branch-commits] [llvm] [KeyInstr][SimplifyCFG] Remap atoms when folding br to common succ into pred (PR #133482)

2025-05-02 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. Github doesn't present your latest inline comments at the end of the "conversation" tab, but it does present them in the middle in a repeated comment section. Silly github. I think we've discussed the subtleties enough, the tl;dr is that it

[llvm-branch-commits] [llvm] [KeyInstr] Merge atoms in DILocation::getMergedLocation (PR #133480)

2025-05-02 Thread Jeremy Morse via llvm-branch-commits
jmorse wrote: Github has helpfully chucked away my comments; was the unit-test-error that I fixed corrected? If so, LGTM. https://github.com/llvm/llvm-project/pull/133480 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Some initial comments; I made it to about 1000 lines into LVIRReader.cpp. https://github.com/llvm/llvm-project/pull/135440 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.o

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -121,7 +121,24 @@ class LVReader { #undef LV_OBJECT_ALLOCATOR + // Scopes with ranges for current compile unit. It is used to find a line jmorse wrote: (for the benefit of any other reviewers, these have been hoisted out of the object-file and DWARF rea

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -56,6 +61,17 @@ Error LVReaderHandler::createReader(StringRef Filename, LVReaders &Readers, return std::make_unique(Filename, FileFormatName, Pdb, W, ExePath); } +if (isa(Input)) { + IRObjectFile *Ir = cast(

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,300 @@ +//===-- LVIRReader.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,300 @@ +//===-- LVIRReader.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,300 @@ +//===-- LVIRReader.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,300 @@ +//===-- LVIRReader.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -728,14 +514,16 @@ void LVDWARFReader::createLineAndFileRecords( for (const DWARFDebugLine::FileNameEntry &Entry : Lines->Prologue.FileNames) { std::string Directory; - if (Lines->getDirectoryForEntry(Entry, Directory)) -Directory = transformP

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -2124,6 +2125,138 @@ layout and given the number of matches. - Total 71 8 +IR (Textual representation and bitcode) SUPPORT +~~~ +The below example is used to show the IR output ge

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,300 @@ +//===-- LVIRReader.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,2348 @@ +//===-- LVIRReader.cpp ===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: A

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,300 @@ +//===-- LVIRReader.h *- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

2025-05-01 Thread Jeremy Morse via llvm-branch-commits
@@ -29,7 +30,9 @@ namespace logicalview { using LVReaders = std::vector>; using ArgVector = std::vector; -using PdbOrObj = PointerUnion; +using PdbOrObjOrIr = +PointerUnion; jmorse wrote: I feel we should be able to invent a more symbolic name for this ty

[llvm-branch-commits] [llvm] [llvm-debuginfo-analyzer] Add support for LLVM IR format. (PR #135440)

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

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -701,6 +705,11 @@ class DwarfDebug : public DebugHandlerBase { void findForceIsStmtInstrs(const MachineFunction *MF); + /// Find instructions which should get is_stmt applied because they implement + /// key functionality for a source atom, store results in + /// Dwar

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

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

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,78 @@ +# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions --filetype=obj -o - \ +# RUN: | llvm-objdump -d - --no-show-raw-insn \ +# RUN: | FileCheck %s --check-prefix=OBJ + +# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions

[llvm-branch-commits] [llvm] Propagate DebugLocs on phis in BreakCriticalEdges (PR #133492)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
jmorse wrote: It can't hurt, let's making things slightly more correct! https://github.com/llvm/llvm-project/pull/133492 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,78 @@ +# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions --filetype=obj -o - \ +# RUN: | llvm-objdump -d - --no-show-raw-insn \ +# RUN: | FileCheck %s --check-prefix=OBJ + +# RUN: llc %s --start-after=livedebugvalues --dwarf-use-key-instructions

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,117 @@ +; RUN: llc %s --filetype=obj -o - --dwarf-use-key-instructions \ +; RUN: | llvm-objdump -d - --no-show-raw-insn \ +; RUN: | FileCheck %s --check-prefix=OBJ + +; RUN: llc %s --filetype=obj -o - --dwarf-use-key-instructions \ +; RUN: | llvm-dwarfdump - --debug-lin

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Tests: I'd personally prefer the input source and explanation at the top of the file, although this is a style thing. My understanding of this code is that within a basic block, it should be possible for there to be two sequences of instructions of equal gr

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) { return PrologEndLoc; } +void DwarfDebug::findKeyInstructions(const MachineFunction *MF) { + // New function - reset KeyInstructions. + KeyInstructions.clear(); + + //

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) { return PrologEndLoc; } +void DwarfDebug::findKeyInstructions(const MachineFunction *MF) { + // New function - reset KeyInstructions. + KeyInstructions.clear(); + + //

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) { return PrologEndLoc; } +void DwarfDebug::findKeyInstructions(const MachineFunction *MF) { + // New function - reset KeyInstructions. + KeyInstructions.clear(); + + //

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: I get the impression that `GroupCandidates` and `KeyInstructions` are being kept strictly in sync; thus couldn't one instead just load KeyInstructions from GroupCandidates once the scan is complete? This avoids filling up the dense map with tombstones. Am

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) { return PrologEndLoc; } +void DwarfDebug::findKeyInstructions(const MachineFunction *MF) { + // New function - reset KeyInstructions. + KeyInstructions.clear(); + + //

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2087,13 +2095,18 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) { // If we have an ongoing unspecified location, nothing to do here. if (!DL) return; -// We have an explicit location, same as the previous location. -// But we might be co

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) { return PrologEndLoc; } +void DwarfDebug::findKeyInstructions(const MachineFunction *MF) { + // New function - reset KeyInstructions. + KeyInstructions.clear(); + + //

[llvm-branch-commits] [llvm] [KeyInstr][DwarfDebug] Add is_stmt emission support (PR #133495)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -2333,6 +2352,170 @@ DwarfDebug::emitInitialLocDirective(const MachineFunction &MF, unsigned CUID) { return PrologEndLoc; } +void DwarfDebug::findKeyInstructions(const MachineFunction *MF) { + // New function - reset KeyInstructions. + KeyInstructions.clear(); + + //

  1   2   >