legalize-constant.mir
2.68 KB
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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=i386-linux-gnu -mattr=+sse2 -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
--- |
define void @test_constant() { ret void }
define void @test_fconstant() { ret void }
...
---
name: test_constant
registers:
- { id: 0, class: _ }
- { id: 1, class: _ }
- { id: 2, class: _ }
- { id: 3, class: _ }
- { id: 4, class: _ }
body: |
bb.1 (%ir-block.0):
; X32-LABEL: name: test_constant
; X32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; X32: $eax = COPY [[C]](s32)
; X32: [[C1:%[0-9]+]]:_(s8) = G_CONSTANT i8 8
; X32: $al = COPY [[C1]](s8)
; X32: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 16
; X32: $ax = COPY [[C2]](s16)
; X32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
; X32: $eax = COPY [[C3]](s32)
; X32: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 64
; X32: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; X32: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[C4]](s32), [[C5]](s32)
; X32: $rax = COPY [[MV]](s64)
; X32: RET 0
; X64-LABEL: name: test_constant
; X64: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; X64: $eax = COPY [[C]](s32)
; X64: [[C1:%[0-9]+]]:_(s8) = G_CONSTANT i8 8
; X64: $al = COPY [[C1]](s8)
; X64: [[C2:%[0-9]+]]:_(s16) = G_CONSTANT i16 16
; X64: $ax = COPY [[C2]](s16)
; X64: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
; X64: $eax = COPY [[C3]](s32)
; X64: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 64
; X64: $rax = COPY [[C4]](s64)
; X64: RET 0
%0(s1) = G_CONSTANT i1 1
%5:_(s32) = G_ANYEXT %0
$eax = COPY %5
%1(s8) = G_CONSTANT i8 8
$al = COPY %1
%2(s16) = G_CONSTANT i16 16
$ax = COPY %2
%3(s32) = G_CONSTANT i32 32
$eax = COPY %3
%4(s64) = G_CONSTANT i64 64
$rax = COPY %4
RET 0
...
---
name: test_fconstant
registers:
- { id: 0, class: _ }
- { id: 1, class: _ }
body: |
bb.0:
; X32-LABEL: name: test_fconstant
; X32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
; X32: $eax = COPY [[C]](s32)
; X32: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
; X32: $rax = COPY [[C1]](s64)
; X64-LABEL: name: test_fconstant
; X64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
; X64: $eax = COPY [[C]](s32)
; X64: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
; X64: $rax = COPY [[C1]](s64)
%0(s32) = G_FCONSTANT float 1.0
$eax = COPY %0
%1(s64) = G_FCONSTANT double 2.0
$rax = COPY %1
...