Skip to content

Commit 47e1c30

Browse files
committed
Use a simple test
1 parent d60b5b0 commit 47e1c30

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed

llvm/test/CodeGen/X86/machine-block-freq.ll

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# RUN: llc --passes='print<machine-block-freq>' -filetype=null -filetype=null 2>&1 %s | FileCheck %s
2+
3+
--- |
4+
define i32 @is_odd(i32 noundef %n) {
5+
%result = srem i32 %n, 2
6+
%is_odd = icmp eq i32 %result, 1
7+
br i1 %is_odd, label %odd, label %even
8+
odd:
9+
ret i32 1
10+
even:
11+
ret i32 0
12+
}
13+
...
14+
---
15+
name: is_odd
16+
tracksRegLiveness: true
17+
body: |
18+
bb.0 (%ir-block.0):
19+
successors: %bb.2(0x40000000), %bb.1(0x40000000)
20+
liveins: $edi
21+
22+
%0:gr32 = COPY $edi
23+
%1:gr32 = COPY killed %0
24+
%4:gr32 = MOV32ri 2
25+
$eax = COPY %1
26+
CDQ implicit-def $eax, implicit-def $edx, implicit $eax
27+
IDIV32r %4, implicit-def $eax, implicit-def $edx, implicit-def $eflags, implicit $eax, implicit $edx
28+
%5:gr32 = COPY $edx
29+
CMP32ri %5, 1, implicit-def $eflags
30+
JCC_1 %bb.2, 5, implicit $eflags
31+
32+
bb.1.odd:
33+
%7:gr32 = MOV32ri 1
34+
$eax = COPY %7
35+
RET64 implicit $eax
36+
37+
bb.2.even:
38+
%6:gr32 = MOV32r0 implicit-def $eflags
39+
$eax = COPY %6
40+
RET64 implicit $eax
41+
...
42+
43+
# CHECK: block-frequency-info: is_odd
44+
# CHECK: - BB1[odd]: float = 0.5
45+
# CHECK: - BB2[even]: float = 0.5

0 commit comments

Comments
 (0)