• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s
3
4--- |
5  define void @test_mul_i1() { ret void}
6
7  define i16 @test_mul_i16(i16 %arg1, i16 %arg2) {
8    %ret = mul i16 %arg1, %arg2
9    ret i16 %ret
10  }
11
12  define i32 @test_mul_i32(i32 %arg1, i32 %arg2) {
13    %ret = mul i32 %arg1, %arg2
14    ret i32 %ret
15  }
16
17  define i64 @test_mul_i64(i64 %arg1, i64 %arg2) {
18    %ret = mul i64 %arg1, %arg2
19    ret i64 %ret
20  }
21
22...
23---
24name:            test_mul_i1
25alignment:       4
26legalized:       false
27regBankSelected: false
28registers:
29  - { id: 0, class: _, preferred-register: '' }
30  - { id: 1, class: _, preferred-register: '' }
31  - { id: 2, class: _, preferred-register: '' }
32body:             |
33  bb.1 (%ir-block.0):
34
35    ; CHECK-LABEL: name: test_mul_i1
36    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edx
37    ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
38    ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
39    ; CHECK: [[MUL:%[0-9]+]]:_(s8) = G_MUL [[TRUNC]], [[TRUNC1]]
40    ; CHECK: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
41    ; CHECK: [[C:%[0-9]+]]:_(s8) = G_CONSTANT i8 1
42    ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY [[MUL]](s8)
43    ; CHECK: [[AND:%[0-9]+]]:_(s8) = G_AND [[COPY1]], [[C]]
44    ; CHECK: G_STORE [[AND]](s8), [[DEF]](p0) :: (store 1)
45    ; CHECK: RET 0
46    %0(s32) = COPY $edx
47    %1(s1) = G_TRUNC %0(s32)
48    %2(s1) = G_MUL %1, %1
49    %3:_(p0) = G_IMPLICIT_DEF
50    G_STORE %2, %3 :: (store 1)
51    RET 0
52...
53---
54name:            test_mul_i16
55alignment:       4
56legalized:       false
57regBankSelected: false
58registers:
59  - { id: 0, class: _ }
60  - { id: 1, class: _ }
61  - { id: 2, class: _ }
62body:             |
63  bb.1 (%ir-block.0):
64    liveins: $edi, $esi
65
66    ; CHECK-LABEL: name: test_mul_i16
67    ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $di
68    ; CHECK: [[COPY1:%[0-9]+]]:_(s16) = COPY $si
69    ; CHECK: [[MUL:%[0-9]+]]:_(s16) = G_MUL [[COPY]], [[COPY1]]
70    ; CHECK: $ax = COPY [[MUL]](s16)
71    ; CHECK: RET 0, implicit $ax
72    %0(s16) = COPY $di
73    %1(s16) = COPY $si
74    %2(s16) = G_MUL %0, %1
75    $ax = COPY %2(s16)
76    RET 0, implicit $ax
77
78...
79---
80name:            test_mul_i32
81alignment:       4
82legalized:       false
83regBankSelected: false
84registers:
85  - { id: 0, class: _ }
86  - { id: 1, class: _ }
87  - { id: 2, class: _ }
88body:             |
89  bb.1 (%ir-block.0):
90    liveins: $edi, $esi
91
92    ; CHECK-LABEL: name: test_mul_i32
93    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
94    ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
95    ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]]
96    ; CHECK: $eax = COPY [[MUL]](s32)
97    ; CHECK: RET 0, implicit $eax
98    %0(s32) = COPY $edi
99    %1(s32) = COPY $esi
100    %2(s32) = G_MUL %0, %1
101    $eax = COPY %2(s32)
102    RET 0, implicit $eax
103
104...
105---
106name:            test_mul_i64
107alignment:       4
108legalized:       false
109regBankSelected: false
110registers:
111  - { id: 0, class: _ }
112  - { id: 1, class: _ }
113  - { id: 2, class: _ }
114body:             |
115  bb.1 (%ir-block.0):
116    liveins: $rdi, $rsi
117
118    ; CHECK-LABEL: name: test_mul_i64
119    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
120    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $rsi
121    ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]]
122    ; CHECK: $rax = COPY [[MUL]](s64)
123    ; CHECK: RET 0, implicit $rax
124    %0(s64) = COPY $rdi
125    %1(s64) = COPY $rsi
126    %2(s64) = G_MUL %0, %1
127    $rax = COPY %2(s64)
128    RET 0, implicit $rax
129
130...
131