================
@@ -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 -triple x86_64-linux-gnu -gkey-instructions -x c %s
-debug-info-kind=line-tables-only -emit-llvm -o - -gno-column-info \
+// RUN: | FileCheck %s --implicit-check-not atomGroup --implicit-check-not
atomRank
+
+// Check that atomic handling code gets Key Instruction annotations.
+
+_Atomic(unsigned int) x;
+unsigned int y;
+void fun() {
+ unsigned int r1 = __c11_atomic_fetch_add(&x,- 1, __ATOMIC_RELAXED);
+// CHECK: store i32 -1, ptr %.atomictmp, align 4, !dbg
[[LINE11_G2R1:!.*]]
+// CHECK-NEXT: %0 = load i32, ptr %.atomictmp, align 4, !dbg
[[LINE11:!.*]]
+// CHECK-NEXT: %1 = atomicrmw add ptr @x, i32 %0 monotonic, align 4, !dbg
[[LINE11_G2R2:!.*]]
+// CHECK-NEXT: store i32 %1, ptr %atomic-temp, align 4, !dbg
[[LINE11_G2R1]]
----------------
jmorse wrote:
So it's deliberate + desirable that both this and the earlier store of -1 are
group-two-rank-one? (I suppose the buoy-based KIs will float the breakpoint
upwards)
https://github.com/llvm/llvm-project/pull/141624
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits