• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=hexagon -mcpu=hexagonv60 -enable-bsb-sched=0 -enable-pipeliner < %s | FileCheck %s
2; RUN: llc -march=hexagon -mcpu=hexagonv5 -enable-pipeliner < %s | FileCheck %s
3
4; From coremark. Test that we pipeline the matrix multiplication bitextract
5; function. The pipelined code should have two packets.
6
7; CHECK: loop0(.LBB0_[[LOOP:.]],
8; CHECK: .LBB0_[[LOOP]]:
9; CHECK: = extractu([[REG2:(r[0-9]+)]],
10; CHECK: = extractu([[REG2]],
11; CHECK: [[REG0:(r[0-9]+)]] = memh
12; CHECK: [[REG1:(r[0-9]+)]] = memh
13; CHECK: += mpyi
14; CHECK: [[REG2]] = mpyi([[REG0]], [[REG1]])
15; CHECK: endloop0
16
17%union_h2_sem_t = type { i32 }
18
19@sem_i = common global [0 x %union_h2_sem_t] zeroinitializer, align 4
20
21define void @matrix_mul_matrix_bitextract(i32 %N, i32* %C, i16* %A, i16* %B) {
22entry:
23  %cmp53 = icmp eq i32 %N, 0
24  br i1 %cmp53, label %for_end27, label %for_body3_lr_ph_us
25
26for_body3_lr_ph_us:
27  %i_054_us = phi i32 [ %inc26_us, %for_cond1_for_inc25_crit_edge_us ], [ 0, %entry ]
28  %0 = mul i32 %i_054_us, %N
29  %arrayidx9_us_us_gep = getelementptr i16, i16* %A, i32 %0
30  br label %for_body3_us_us
31
32for_cond1_for_inc25_crit_edge_us:
33  %inc26_us = add i32 %i_054_us, 1
34  %exitcond89 = icmp eq i32 %inc26_us, %N
35  br i1 %exitcond89, label %for_end27, label %for_body3_lr_ph_us
36
37for_body3_us_us:
38  %j_052_us_us = phi i32 [ %inc23_us_us, %for_cond4_for_inc22_crit_edge_us_us ], [ 0, %for_body3_lr_ph_us ]
39  %add_us_us = add i32 %j_052_us_us, %0
40  %arrayidx_us_us = getelementptr inbounds i32, i32* %C, i32 %add_us_us
41  store i32 0, i32* %arrayidx_us_us, align 4
42  br label %for_body6_us_us
43
44for_cond4_for_inc22_crit_edge_us_us:
45  store i32 %add21_us_us, i32* %arrayidx_us_us, align 4
46  %inc23_us_us = add i32 %j_052_us_us, 1
47  %exitcond88 = icmp eq i32 %inc23_us_us, %N
48  br i1 %exitcond88, label %for_cond1_for_inc25_crit_edge_us, label %for_body3_us_us
49
50for_body6_us_us:
51  %1 = phi i32 [ 0, %for_body3_us_us ], [ %add21_us_us, %for_body6_us_us ]
52  %arrayidx9_us_us_phi = phi i16* [ %arrayidx9_us_us_gep, %for_body3_us_us ], [ %arrayidx9_us_us_inc, %for_body6_us_us ]
53  %k_050_us_us = phi i32 [ 0, %for_body3_us_us ], [ %inc_us_us, %for_body6_us_us ]
54  %2 = load i16, i16* %arrayidx9_us_us_phi, align 2
55  %conv_us_us = sext i16 %2 to i32
56  %mul10_us_us = mul i32 %k_050_us_us, %N
57  %add11_us_us = add i32 %mul10_us_us, %j_052_us_us
58  %arrayidx12_us_us = getelementptr inbounds i16, i16* %B, i32 %add11_us_us
59  %3 = load i16, i16* %arrayidx12_us_us, align 2
60  %conv13_us_us = sext i16 %3 to i32
61  %mul14_us_us = mul nsw i32 %conv13_us_us, %conv_us_us
62  %shr47_us_us = lshr i32 %mul14_us_us, 2
63  %and_us_us = and i32 %shr47_us_us, 15
64  %shr1548_us_us = lshr i32 %mul14_us_us, 5
65  %and16_us_us = and i32 %shr1548_us_us, 127
66  %mul17_us_us = mul i32 %and_us_us, %and16_us_us
67  %add21_us_us = add i32 %mul17_us_us, %1
68  %inc_us_us = add i32 %k_050_us_us, 1
69  %exitcond87 = icmp eq i32 %inc_us_us, %N
70  %arrayidx9_us_us_inc = getelementptr i16, i16* %arrayidx9_us_us_phi, i32 1
71  br i1 %exitcond87, label %for_cond4_for_inc22_crit_edge_us_us, label %for_body6_us_us
72
73for_end27:
74  ret void
75}
76