xref: /llvm-project/llvm/test/tools/llvm-mca/RISCV/SiFive7/gpr-bypass-c.s (revision d9570babf1b253767a3a6c1450fa1b9e10b4e2f9)
1# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-u74 -mattr=+c -timeline \
3# RUN:   -timeline-max-cycles=1000 -iterations=1 < %s | FileCheck %s
4
5c.lui a0, 1
6c.add a0, a0
7c.addi a0, 1
8c.addw a0, a0
9c.addiw a0, 1
10c.sub a0, a0
11c.subw a0, a0
12c.and a0, a0
13c.andi a0, 1
14c.or a0, a0
15c.xor a0, a0
16c.slli a0, 1
17c.srli a0, 1
18c.srai a0, 1
19c.add a0, a0
20beqz a0, 1f
211:
22c.add a0, a0
23bnez a0, 1f
241:
25c.add a0, a0
26c.jr a0
27
28# CHECK:      Iterations:        1
29# CHECK-NEXT: Instructions:      20
30# CHECK-NEXT: Total Cycles:      21
31# CHECK-NEXT: Total uOps:        20
32
33# CHECK:      Dispatch Width:    2
34# CHECK-NEXT: uOps Per Cycle:    0.95
35# CHECK-NEXT: IPC:               0.95
36# CHECK-NEXT: Block RThroughput: 10.0
37
38# CHECK:      Instruction Info:
39# CHECK-NEXT: [1]: #uOps
40# CHECK-NEXT: [2]: Latency
41# CHECK-NEXT: [3]: RThroughput
42# CHECK-NEXT: [4]: MayLoad
43# CHECK-NEXT: [5]: MayStore
44# CHECK-NEXT: [6]: HasSideEffects (U)
45
46# CHECK:      [1]    [2]    [3]    [4]    [5]    [6]    Instructions:
47# CHECK-NEXT:  1      3     0.50                        lui	a0, 1
48# CHECK-NEXT:  1      3     0.50                        add	a0, a0, a0
49# CHECK-NEXT:  1      3     0.50                        addi	a0, a0, 1
50# CHECK-NEXT:  1      3     0.50                        addw	a0, a0, a0
51# CHECK-NEXT:  1      3     0.50                        addiw	a0, a0, 1
52# CHECK-NEXT:  1      3     0.50                        sub	a0, a0, a0
53# CHECK-NEXT:  1      3     0.50                        subw	a0, a0, a0
54# CHECK-NEXT:  1      3     0.50                        and	a0, a0, a0
55# CHECK-NEXT:  1      3     0.50                        andi	a0, a0, 1
56# CHECK-NEXT:  1      3     0.50                        or	a0, a0, a0
57# CHECK-NEXT:  1      3     0.50                        xor	a0, a0, a0
58# CHECK-NEXT:  1      3     0.50                        slli	a0, a0, 1
59# CHECK-NEXT:  1      3     0.50                        srli	a0, a0, 1
60# CHECK-NEXT:  1      3     0.50                        srai	a0, a0, 1
61# CHECK-NEXT:  1      3     0.50                        add	a0, a0, a0
62# CHECK-NEXT:  1      3     1.00                        beqz	a0, .Ltmp0
63# CHECK-NEXT:  1      3     0.50                        add	a0, a0, a0
64# CHECK-NEXT:  1      3     1.00                        bnez	a0, .Ltmp1
65# CHECK-NEXT:  1      3     0.50                        add	a0, a0, a0
66# CHECK-NEXT:  1      3     1.00                        jr	a0
67
68# CHECK:      Resources:
69# CHECK-NEXT: [0]   - SiFive7FDiv
70# CHECK-NEXT: [1]   - SiFive7IDiv
71# CHECK-NEXT: [2]   - SiFive7PipeA
72# CHECK-NEXT: [3]   - SiFive7PipeB
73# CHECK-NEXT: [4]   - SiFive7VA
74# CHECK-NEXT: [5]   - SiFive7VCQ
75# CHECK-NEXT: [6]   - SiFive7VL
76# CHECK-NEXT: [7]   - SiFive7VS
77
78# CHECK:      Resource pressure per iteration:
79# CHECK-NEXT: [0]    [1]    [2]    [3]    [4]    [5]    [6]    [7]
80# CHECK-NEXT:  -      -     9.00   11.00   -      -      -      -
81
82# CHECK:      Resource pressure by instruction:
83# CHECK-NEXT: [0]    [1]    [2]    [3]    [4]    [5]    [6]    [7]    Instructions:
84# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     lui	a0, 1
85# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     add	a0, a0, a0
86# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     addi	a0, a0, 1
87# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     addw	a0, a0, a0
88# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     addiw	a0, a0, 1
89# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     sub	a0, a0, a0
90# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     subw	a0, a0, a0
91# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     and	a0, a0, a0
92# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     andi	a0, a0, 1
93# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     or	a0, a0, a0
94# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     xor	a0, a0, a0
95# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     slli	a0, a0, 1
96# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     srli	a0, a0, 1
97# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     srai	a0, a0, 1
98# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     add	a0, a0, a0
99# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     beqz	a0, .Ltmp0
100# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     add	a0, a0, a0
101# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     bnez	a0, .Ltmp1
102# CHECK-NEXT:  -      -     1.00    -      -      -      -      -     add	a0, a0, a0
103# CHECK-NEXT:  -      -      -     1.00    -      -      -      -     jr	a0
104
105# CHECK:      Timeline view:
106# CHECK-NEXT:                     0123456789
107# CHECK-NEXT: Index     0123456789          0
108
109# CHECK:      [0,0]     DeeE .    .    .    .   lui	a0, 1
110# CHECK-NEXT: [0,1]     .DeeE.    .    .    .   add	a0, a0, a0
111# CHECK-NEXT: [0,2]     . DeeE    .    .    .   addi	a0, a0, 1
112# CHECK-NEXT: [0,3]     .  DeeE   .    .    .   addw	a0, a0, a0
113# CHECK-NEXT: [0,4]     .   DeeE  .    .    .   addiw	a0, a0, 1
114# CHECK-NEXT: [0,5]     .    DeeE .    .    .   sub	a0, a0, a0
115# CHECK-NEXT: [0,6]     .    .DeeE.    .    .   subw	a0, a0, a0
116# CHECK-NEXT: [0,7]     .    . DeeE    .    .   and	a0, a0, a0
117# CHECK-NEXT: [0,8]     .    .  DeeE   .    .   andi	a0, a0, 1
118# CHECK-NEXT: [0,9]     .    .   DeeE  .    .   or	a0, a0, a0
119# CHECK-NEXT: [0,10]    .    .    DeeE .    .   xor	a0, a0, a0
120# CHECK-NEXT: [0,11]    .    .    .DeeE.    .   slli	a0, a0, 1
121# CHECK-NEXT: [0,12]    .    .    . DeeE    .   srli	a0, a0, 1
122# CHECK-NEXT: [0,13]    .    .    .  DeeE   .   srai	a0, a0, 1
123# CHECK-NEXT: [0,14]    .    .    .   DeeE  .   add	a0, a0, a0
124# CHECK-NEXT: [0,15]    .    .    .    DeeE .   beqz	a0, .Ltmp0
125# CHECK-NEXT: [0,16]    .    .    .    DeeE .   add	a0, a0, a0
126# CHECK-NEXT: [0,17]    .    .    .    .DeeE.   bnez	a0, .Ltmp1
127# CHECK-NEXT: [0,18]    .    .    .    .DeeE.   add	a0, a0, a0
128# CHECK-NEXT: [0,19]    .    .    .    . DeeE   jr	a0
129
130# CHECK:      Average Wait times (based on the timeline view):
131# CHECK-NEXT: [0]: Executions
132# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue
133# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready
134# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage
135
136# CHECK:            [0]    [1]    [2]    [3]
137# CHECK-NEXT: 0.     1     0.0    0.0    0.0       lui	a0, 1
138# CHECK-NEXT: 1.     1     0.0    0.0    0.0       add	a0, a0, a0
139# CHECK-NEXT: 2.     1     0.0    0.0    0.0       addi	a0, a0, 1
140# CHECK-NEXT: 3.     1     0.0    0.0    0.0       addw	a0, a0, a0
141# CHECK-NEXT: 4.     1     0.0    0.0    0.0       addiw	a0, a0, 1
142# CHECK-NEXT: 5.     1     0.0    0.0    0.0       sub	a0, a0, a0
143# CHECK-NEXT: 6.     1     0.0    0.0    0.0       subw	a0, a0, a0
144# CHECK-NEXT: 7.     1     0.0    0.0    0.0       and	a0, a0, a0
145# CHECK-NEXT: 8.     1     0.0    0.0    0.0       andi	a0, a0, 1
146# CHECK-NEXT: 9.     1     0.0    0.0    0.0       or	a0, a0, a0
147# CHECK-NEXT: 10.    1     0.0    0.0    0.0       xor	a0, a0, a0
148# CHECK-NEXT: 11.    1     0.0    0.0    0.0       slli	a0, a0, 1
149# CHECK-NEXT: 12.    1     0.0    0.0    0.0       srli	a0, a0, 1
150# CHECK-NEXT: 13.    1     0.0    0.0    0.0       srai	a0, a0, 1
151# CHECK-NEXT: 14.    1     0.0    0.0    0.0       add	a0, a0, a0
152# CHECK-NEXT: 15.    1     0.0    0.0    0.0       beqz	a0, .Ltmp0
153# CHECK-NEXT: 16.    1     0.0    0.0    0.0       add	a0, a0, a0
154# CHECK-NEXT: 17.    1     0.0    0.0    0.0       bnez	a0, .Ltmp1
155# CHECK-NEXT: 18.    1     0.0    0.0    0.0       add	a0, a0, a0
156# CHECK-NEXT: 19.    1     0.0    0.0    0.0       jr	a0
157# CHECK-NEXT:        1     0.0    0.0    0.0       <total>
158