[llvm-branch-commits] [clang] [KeyInstr][Clang] While stmt atom (PR #134645)
Jeremy Morse via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu May 22 16:42:24 PDT 2025
================
@@ -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-kind=line-tables-only -emit-llvm -o - \
+// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not atomRank
+
+// Perennial quesiton: should the `dec` be in its own source atom or not
+// (currently it is).
+
+// We've made the cmp and br separate source atoms for now, to match existing
+// behaviour in this case:
+// 1. while (
+// 2. int i = --End
+// 3. ) {
+// 4. useValue(i);
+// 5. }
+// Without Key Instructions we go: 2, 1[, 4, 2, 1]+
+// Without separating cmp and br with Key Instructions we'd get:
+// 1[, 4, 1]+. If we made the cmp higher precedence than the
+// br and had them in the same group, we could get:
+// 2, [4, 2]+ which might be nicer. FIXME: do that later.
----------------
jmorse wrote:
I endorse this FIXME
https://github.com/llvm/llvm-project/pull/134645
More information about the llvm-branch-commits
mailing list