File: combine-vscale.mir

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (113 lines) | stat: -rw-r--r-- 3,532 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -o - -mtriple=aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s | FileCheck %s

...
---
name:            sum_of_vscale
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: sum_of_vscale
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %sum:_(s64) = G_VSCALE i64 20
    ; CHECK-NEXT: $x0 = COPY %sum(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %rhs:_(s64) = G_VSCALE i64 11
    %lhs:_(s64) = G_VSCALE i64 9
    %sum:_(s64) = nsw G_ADD %lhs(s64), %rhs(s64)
    $x0 = COPY %sum(s64)
    RET_ReallyLR implicit $x0
...
---
name:            sum_of_vscale_multi_use
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: sum_of_vscale_multi_use
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %rhs:_(s64) = G_VSCALE i64 11
    ; CHECK-NEXT: %lhs:_(s64) = G_VSCALE i64 9
    ; CHECK-NEXT: %sum:_(s64) = nsw G_ADD %lhs, %rhs
    ; CHECK-NEXT: $x0 = COPY %sum(s64)
    ; CHECK-NEXT: $x1 = COPY %rhs(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %rhs:_(s64) = G_VSCALE i64 11
    %lhs:_(s64) = G_VSCALE i64 9
    %sum:_(s64) = nsw G_ADD %lhs(s64), %rhs(s64)
    $x0 = COPY %sum(s64)
    $x1 = COPY %rhs(s64)
    RET_ReallyLR implicit $x0
...
---
name:            mul_of_vscale
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: mul_of_vscale
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %mul:_(s64) = G_VSCALE i64 99
    ; CHECK-NEXT: $x0 = COPY %mul(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %rhs:_(s64) = G_CONSTANT i64 11
    %lhs:_(s64) = G_VSCALE i64 9
    %mul:_(s64) = nsw G_MUL %lhs(s64), %rhs(s64)
    $x0 = COPY %mul(s64)
    RET_ReallyLR implicit $x0
...
---
name:            sub_of_vscale
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: sub_of_vscale
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %x:_(s64) = COPY $x0
    ; CHECK-NEXT: [[VSCALE:%[0-9]+]]:_(s64) = G_VSCALE i64 -9
    ; CHECK-NEXT: %sub:_(s64) = nsw G_ADD %x, [[VSCALE]]
    ; CHECK-NEXT: $x0 = COPY %sub(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %x:_(s64) = COPY $x0
    %rhs:_(s64) = G_VSCALE i64 9
    %sub:_(s64) = nsw G_SUB %x(s64), %rhs(s64)
    $x0 = COPY %sub(s64)
    RET_ReallyLR implicit $x0
...
---
name:            shl_of_vscale
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: shl_of_vscale
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %shl:_(s64) = G_VSCALE i64 44
    ; CHECK-NEXT: $x0 = COPY %shl(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %rhs:_(s64) = G_CONSTANT i64 2
    %lhs:_(s64) = G_VSCALE i64 11
    %shl:_(s64) = nsw G_SHL %lhs(s64), %rhs(s64)
    $x0 = COPY %shl(s64)
    RET_ReallyLR implicit $x0
...
---
name:            shl_of_vscale_wrong_flag
body:             |
  bb.1:
    liveins: $x0, $x1
    ; CHECK-LABEL: name: shl_of_vscale_wrong_flag
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %rhs:_(s64) = G_CONSTANT i64 2
    ; CHECK-NEXT: %lhs:_(s64) = G_VSCALE i64 11
    ; CHECK-NEXT: %shl:_(s64) = nuw G_SHL %lhs, %rhs(s64)
    ; CHECK-NEXT: $x0 = COPY %shl(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %rhs:_(s64) = G_CONSTANT i64 2
    %lhs:_(s64) = G_VSCALE i64 11
    %shl:_(s64) = nuw G_SHL %lhs(s64), %rhs(s64)
    $x0 = COPY %shl(s64)
    RET_ReallyLR implicit $x0