llvm-project/llvm/test/Transforms/SampleProfile/pseudo-probe-instsched.ll
Hongtao Yu d9b511d8e8 [CSSPGO] Set PseudoProbeInserter as a default pass.
Currenlty PseudoProbeInserter is a pass conditioned on a target switch. It works well with a single clang invocation. It doesn't work so well when the backend is called separately (i.e, through the linker or llc), where user has always to pass -pseudo-probe-for-profiling explictly. I'm making the pass a default pass that requires no command line arg to trigger, but will be actually run depending on whether the CU comes with `llvm.pseudo_probe_desc` metadata.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D110209
2021-09-22 09:09:48 -07:00

34 lines
901 B
LLVM

; REQUIRES: x86_64-linux
; RUN: llc < %s -mcpu=generic -mtriple=x86_64-- -O3 | FileCheck %s
define float @foo(float %x) #0 {
%tmp1 = fmul float %x, 3.000000e+00
%tmp3 = fmul float %x, 5.000000e+00
%tmp5 = fmul float %x, 7.000000e+00
%tmp7 = fmul float %x, 1.100000e+01
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 1, i32 0, i64 -1)
%tmp10 = fadd float %tmp1, %tmp3
%tmp12 = fadd float %tmp10, %tmp5
%tmp14 = fadd float %tmp12, %tmp7
ret float %tmp14
; CHECK: mulss
; CHECK: mulss
; CHECK: addss
; CHECK: mulss
; CHECK: addss
; CHECK: mulss
; CHECK: addss
; CHECK: ret
}
; Function Attrs: inaccessiblememonly nounwind willreturn
declare void @llvm.pseudoprobe(i64, i64, i32, i64) #1
attributes #0 = { nounwind }
attributes #1 = { inaccessiblememonly nounwind willreturn }
!llvm.pseudo_probe_desc = !{!0}
!0 = !{i64 6699318081062747564, i64 4294967295, !"foo", null}