[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(); + + //

[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 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] Add MIR parser support (PR #133494)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/133494 ___ 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] Remap cloned PHIs in BreakCriticalEdges (PR #133493)

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

[llvm-branch-commits] [llvm] [KeyInstr] Remap cloned PHIs in BreakCriticalEdges (PR #133493)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -0,0 +1,52 @@ +; RUN: opt -passes='require,function(codegenprepare)' -S -mtriple=x86_64 < %s \ +; RUN: | FileCheck %s + +;; Check debug locations are propagated onto new PHIs. jmorse wrote: "...and that source locations have their atom groups remapped" https

[llvm-branch-commits] [llvm] [KeyInstr] Remap cloned PHIs in BreakCriticalEdges (PR #133493)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/133493 ___ 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] Add Atom Group waterline to LLVMContext (PR #133478)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM with the style nits https://github.com/llvm/llvm-project/pull/133478 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

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

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. I continued my ramblings inline; I see the potential for some slightly unexpected stepping behaviour, but still strictly better than todays "everything is a breakpoint" approach. I don't think I can put my finger on a specific bad behaviour

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

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -1243,6 +1243,140 @@ TEST_F(DILocationTest, Merge) { auto *M2 = DILocation::getMergedLocation(A2, B); EXPECT_EQ(M1, M2); } + +#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS +#define EXPECT_ATOM(Loc, Group, Rank) \ + EXPECT_EQ(Group,

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

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/133482 ___ 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][SimplifyCFG] Remap atoms when folding br to common succ into pred (PR #133482)

2025-04-23 Thread Jeremy Morse via llvm-branch-commits
@@ -1129,13 +1130,17 @@ static void cloneInstructionsIntoPredecessorBlockAndUpdateSSAUses( Instruction *NewBonusInst = BonusInst.clone(); -if (!isa(BonusInst) && -PTI->getDebugLoc() != NewBonusInst->getDebugLoc()) { - // Unless the instruction has the sa

[llvm-branch-commits] [llvm] [KeyInstr][LoopUnswitch] Remap cloned instructions' atoms (PR #133491)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. Seems fine, but the test is hard to decipher, future generations will praise us if it can be simplified. https://github.com/llvm/llvm-project/pull/133491 ___ llvm-branch-commits mailing list llvm-b

[llvm-branch-commits] [llvm] [KeyInstr][LoopRotate] Remap atoms of duplicated instructions (PR #133490)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/133490 ___ 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][LoopRotate] Remap atoms of duplicated instructions (PR #133490)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. LGTM (although the hand-written tests are more fun and easier to read) https://github.com/llvm/llvm-project/pull/133490 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https:

[llvm-branch-commits] [llvm] [KeyInstr][LoopUnroll] Remap atoms while unrolling (PR #133489)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
@@ -752,6 +752,14 @@ llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI, } } + // Remap source location atom instance. Do this now, rather than + // when we remap instructions, because remap is called once we've + // cloned all blocks (

[llvm-branch-commits] [llvm] [KeyInstr][LoopUnroll] Remap atoms while unrolling (PR #133489)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse commented: Looks good, but question inline https://github.com/llvm/llvm-project/pull/133489 ___ 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] [llvm] [KeyInstr][LoopUnroll] Remap atoms while unrolling (PR #133489)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse edited https://github.com/llvm/llvm-project/pull/133489 ___ 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][JumpThreading] Remap atoms duping bb with cond br on phi into pred (PR #133488)

2025-04-11 Thread Jeremy Morse via llvm-branch-commits
https://github.com/jmorse approved this pull request. Whilst being some complicated threading, LGTM https://github.com/llvm/llvm-project/pull/133488 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

  1   2   >