xref: /llvm-project/llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll (revision 9ff36df5a4a7d52c51e950522870bb64912688d2)
1acead46aSFangrui Song; RUN: opt < %s -S -passes=instrprof -instrprof-atomic-counter-update-all | FileCheck %s
2ee6c233aSVedant Kumar
3ee6c233aSVedant Kumartarget triple = "x86_64-apple-macosx10.10.0"
4ee6c233aSVedant Kumar
59f506fc7SFangrui Song@__profn_foo = private constant [3 x i8] c"foo"
6ee6c233aSVedant Kumar
7ee6c233aSVedant Kumar; CHECK-LABEL: define void @foo
8*9ff36df5SFangrui Song; CHECK-NEXT: atomicrmw add ptr @__profc_foo, i64 1 monotonic
9ee6c233aSVedant Kumardefine void @foo() {
10*9ff36df5SFangrui Song  call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
11ee6c233aSVedant Kumar  ret void
12ee6c233aSVedant Kumar}
13ee6c233aSVedant Kumar
14*9ff36df5SFangrui Songdeclare void @llvm.instrprof.increment(ptr, i64, i32, i32)
15