1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll
Hongtao Yu d0ebd8797c [CSSPGO] Exclude pseudo probes from slot index
Pseudo probe are currently given a slot index like other regular instructions. This affects register pressure and lifetime weight computation because of enlarged lifetime length with pseudo probe instructions. As a consequence, program could get different code generated w/ and w/o pseudo probes. I'm closing the gap by excluding pseudo probes from stack index and downstream register allocation related passes.

Reviewed By: wmi

Differential Revision: https://reviews.llvm.org/D100334
2021-04-19 17:55:35 -07:00

22 lines
761 B
LLVM

; REQUIRES: x86_64-linux
; RUN: llc -print-after=slotindexes -stop-after=slotindexes -mtriple=x86_64-- %s -filetype=asm -o %t 2>&1 | FileCheck %s
define void @foo(i32* %p) {
store i32 0, i32* %p
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
store i32 0, i32* %p
ret void
}
;; Check the pseudo probe instruction isn't assigned a slot index.
;CHECK: IR Dump {{.*}}
;CHECK: # Machine code for function foo{{.*}}
;CHECK: {{[0-9]+}}B bb.0 (%ir-block.0)
;CHECK: {{[0-9]+}}B %0:gr64 = COPY killed $rdi
;CHECK: {{^}} PSEUDO_PROBE 5116412291814990879
;CHECK: {{[0-9]+}}B MOV32mi
;CHECK: {{[0-9]+}}B RET 0
declare void @llvm.pseudoprobe(i64, i64, i32, i64) #0
attributes #0 = { inaccessiblememonly nounwind willreturn }