xref: /llvm-project/llvm/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll (revision 0271ae65a66367d802fa6866599d11e35f68450f)
1b98807dfSHongtao Yu; REQUIRES: x86_64-linux
2b98807dfSHongtao Yu; RUN: llc -print-after=slotindexes -stop-after=slotindexes -mtriple=x86_64-- %s -filetype=asm -o %t 2>&1 | FileCheck %s
3b98807dfSHongtao Yu
4*0271ae65SFangrui Songdefine void @foo(ptr %p) {
5*0271ae65SFangrui Song  store i32 0, ptr %p
6b98807dfSHongtao Yu  call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
7*0271ae65SFangrui Song  store i32 0, ptr %p
8b98807dfSHongtao Yu  ret void
9b98807dfSHongtao Yu}
10b98807dfSHongtao Yu
11b98807dfSHongtao Yu;; Check the pseudo probe instruction isn't assigned a slot index.
12b98807dfSHongtao Yu;CHECK: IR Dump {{.*}}
13b98807dfSHongtao Yu;CHECK: # Machine code for function foo{{.*}}
14b98807dfSHongtao Yu;CHECK: {{[0-9]+}}B  bb.0 (%ir-block.0)
15b98807dfSHongtao Yu;CHECK: {{[0-9]+}}B	 %0:gr64 = COPY killed $rdi
16b98807dfSHongtao Yu;CHECK: {{^}}        PSEUDO_PROBE 5116412291814990879
17b98807dfSHongtao Yu;CHECK: {{[0-9]+}}B	 MOV32mi
18b98807dfSHongtao Yu;CHECK: {{[0-9]+}}B	 RET 0
19b98807dfSHongtao Yu
20b98807dfSHongtao Yudeclare void @llvm.pseudoprobe(i64, i64, i32, i64) #0
21b98807dfSHongtao Yu
22b98807dfSHongtao Yuattributes #0 = { inaccessiblememonly nounwind willreturn }