File: combine-mulo-with-2.mir

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (117 lines) | stat: -rw-r--r-- 3,952 bytes parent folder | download | duplicates (6)
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
114
115
116
117
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -debugify-and-strip-all-safe -run-pass=aarch64-prelegalizer-combiner --aarch64prelegalizercombinerhelper-only-enable-rule="mulo_by_2" -global-isel -verify-machineinstrs %s -o - | FileCheck %s
# REQUIRES: asserts
...
---
name:            smulo_to_saddo
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0

    ; CHECK-LABEL: name: smulo_to_saddo
    ; CHECK: liveins: $x0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(s64) = COPY $x0
    ; CHECK-NEXT: %mul:_(s64), %o:_(s1) = G_SADDO %copy, %copy
    ; CHECK-NEXT: %overflow_ext:_(s32) = G_ZEXT %o(s1)
    ; CHECK-NEXT: $w0 = COPY %overflow_ext(s32)
    ; CHECK-NEXT: RET_ReallyLR implicit $w0
    %copy:_(s64) = COPY $x0
    %two:_(s64) = G_CONSTANT i64 2
    %mul:_(s64), %o:_(s1) = G_SMULO %copy, %two
    %overflow_ext:_(s32) = G_ZEXT %o(s1)
    $w0 = COPY %overflow_ext(s32)
    RET_ReallyLR implicit $w0
...
---
name:            umulo_to_uaddo
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0

    ; CHECK-LABEL: name: umulo_to_uaddo
    ; CHECK: liveins: $x0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(s64) = COPY $x0
    ; CHECK-NEXT: %mul:_(s64), %o:_(s1) = G_UADDO %copy, %copy
    ; CHECK-NEXT: %overflow_ext:_(s32) = G_ZEXT %o(s1)
    ; CHECK-NEXT: $w0 = COPY %overflow_ext(s32)
    ; CHECK-NEXT: RET_ReallyLR implicit $w0
    %copy:_(s64) = COPY $x0
    %two:_(s64) = G_CONSTANT i64 2
    %mul:_(s64), %o:_(s1) = G_UMULO %copy, %two
    %overflow_ext:_(s32) = G_ZEXT %o(s1)
    $w0 = COPY %overflow_ext(s32)
    RET_ReallyLR implicit $w0
...
---
name:            vector
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $d0, $d1

    ; CHECK-LABEL: name: vector
    ; CHECK: liveins: $d0, $d1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(<2 x s32>) = COPY $d0
    ; CHECK-NEXT: %mul:_(<2 x s32>), %o:_(<2 x s1>) = G_SADDO %copy, %copy
    ; CHECK-NEXT: %overflow_ext:_(<2 x s32>) = G_ANYEXT %o(<2 x s1>)
    ; CHECK-NEXT: $d0 = COPY %overflow_ext(<2 x s32>)
    ; CHECK-NEXT: RET_ReallyLR implicit $d0
    %copy:_(<2 x s32>) = COPY $d0
    %two:_(s32) = G_CONSTANT i32 2
    %splat_two:_(<2 x s32>) = G_BUILD_VECTOR %two(s32), %two(s32)
    %mul:_(<2 x s32>), %o:_(<2 x s1>) = G_SMULO %copy, %splat_two
    %overflow_ext:_(<2 x s32>) = G_ANYEXT %o(<2 x s1>)
    $d0 = COPY %overflow_ext(<2 x s32>)
    RET_ReallyLR implicit $d0
...
---
name:            dont_combine_wrong_cst
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0

    ; CHECK-LABEL: name: dont_combine_wrong_cst
    ; CHECK: liveins: $x0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(s64) = COPY $x0
    ; CHECK-NEXT: %three:_(s64) = G_CONSTANT i64 3
    ; CHECK-NEXT: %mul:_(s64), %o:_(s1) = G_UMULO %copy, %three
    ; CHECK-NEXT: %overflow_ext:_(s32) = G_ZEXT %o(s1)
    ; CHECK-NEXT: $w0 = COPY %overflow_ext(s32)
    ; CHECK-NEXT: RET_ReallyLR implicit $w0
    %copy:_(s64) = COPY $x0
    %three:_(s64) = G_CONSTANT i64 3
    %mul:_(s64), %o:_(s1) = G_UMULO %copy, %three
    %overflow_ext:_(s32) = G_ZEXT %o(s1)
    $w0 = COPY %overflow_ext(s32)
    RET_ReallyLR implicit $w0
...
---
name:            dont_combine_not_cst
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0, $x1

    ; CHECK-LABEL: name: dont_combine_not_cst
    ; CHECK: liveins: $x0, $x1
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy1:_(s64) = COPY $x0
    ; CHECK-NEXT: %copy2:_(s64) = COPY $x1
    ; CHECK-NEXT: %mul:_(s64), %o:_(s1) = G_UMULO %copy1, %copy2
    ; CHECK-NEXT: %overflow_ext:_(s32) = G_ZEXT %o(s1)
    ; CHECK-NEXT: $w0 = COPY %overflow_ext(s32)
    ; CHECK-NEXT: RET_ReallyLR implicit $w0
    %copy1:_(s64) = COPY $x0
    %copy2:_(s64) = COPY $x1
    %mul:_(s64), %o:_(s1) = G_UMULO %copy1, %copy2
    %overflow_ext:_(s32) = G_ZEXT %o(s1)
    $w0 = COPY %overflow_ext(s32)
    RET_ReallyLR implicit $w0
...