File: cast-call-combine-prof.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (53 lines) | stat: -rw-r--r-- 1,607 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
; RUN: opt -S -passes=instcombine < %s | FileCheck -enable-var-scope %s

; Check that instcombine preserves !prof metadata when removing function
; prototype casts.

declare i32 @__gxx_personality_v0(...)
declare void @__cxa_call_unexpected(ptr)
declare void @foo(ptr %a)

; CHECK-LABEL: @test_call()
; CHECK: call void @foo(ptr null), !prof ![[$PROF:[0-9]+]]
define void @test_call() {
  call void @foo (ptr null), !prof !0
  ret void
}

; CHECK-LABEL: @test_invoke()
; CHECK: invoke void @foo(ptr null)
; CHECK-NEXT: to label %done unwind label %lpad, !prof ![[$PROF]]
define void @test_invoke() personality ptr @__gxx_personality_v0 {
  invoke void @foo (ptr null)
          to label %done unwind label %lpad, !prof !0

done:
  ret void

lpad:
  %lp = landingpad { ptr, i32 }
          filter [0 x ptr] zeroinitializer
  %ehptr = extractvalue { ptr, i32 } %lp, 0
  tail call void @__cxa_call_unexpected(ptr %ehptr) noreturn nounwind
  unreachable
}

; CHECK: ![[$PROF]] = !{!"VP", i32 0, i64 2000, i64 -3913987384944532146, i64 2000}
!0 = !{!"VP", i32 0, i64 2000, i64 -3913987384944532146, i64 2000}

!llvm.module.flags = !{!1}

!1 = !{i32 1, !"ProfileSummary", !2}
!2 = !{!3, !4, !5, !6, !7, !8, !9, !10}
!3 = !{!"ProfileFormat", !"InstrProf"}
!4 = !{!"TotalCount", i64 10000}
!5 = !{!"MaxCount", i64 1000}
!6 = !{!"MaxInternalCount", i64 1}
!7 = !{!"MaxFunctionCount", i64 1000}
!8 = !{!"NumCounts", i64 3}
!9 = !{!"NumFunctions", i64 3}
!10 = !{!"DetailedSummary", !11}
!11 = !{!12, !13, !14}
!12 = !{i32 10000, i64 1000, i32 1}
!13 = !{i32 999000, i64 1000, i32 1}
!14 = !{i32 999999, i64 1, i32 2}