mirCanonIdempotent.mir
4.92 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
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
118
119
120
121
122
123
124
125
# RUN: llc -mtriple=arm64-apple-ios11.0.0 -o - -verify-machineinstrs -run-pass mir-canonicalizer %s | FileCheck %s
# These Idempotent instructions are sorted alphabetically (based on after the '=')
# CHECK: %bb0_{{[0-9]+}}__1:gpr64 = MOVi64imm 4617315517961601024
# CHECK-NEXT: %bb0_{{[0-9]+}}__1:gpr32 = MOVi32imm 408
# CHECK-NEXT: %bb0_{{[0-9]+}}__2:gpr32 = MOVi32imm 408
# CHECK-NEXT: %bb0_{{[0-9]+}}__1:gpr64all = IMPLICIT_DEF
# CHECK-NEXT: %bb0_{{[0-9]+}}__1:fpr64 = FMOVDi 20
# CHECK-NEXT: %bb0_{{[0-9]+}}__1:fpr64 = FMOVDi 112
...
---
name: Proc8
stack:
- { id: 0, type: default, offset: 0, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -4, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
- { id: 1, type: default, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -16, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
- { id: 2, type: default, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -24, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
- { id: 3, type: default, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -32, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
- { id: 4, type: default, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -40, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
- { id: 5, type: default, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -48, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
- { id: 6, type: default, offset: 0, size: 8, alignment: 8,
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
local-offset: -56, debug-info-variable: '', debug-info-expression: '',
debug-info-location: '' }
constants:
body: |
bb.0:
liveins: $x0, $x1, $d0, $d1
%3:fpr64 = COPY $d1
%2:fpr64 = COPY $d0
%1:gpr64 = COPY $x1
%0:gpr64common = COPY $x0
STRXui %0, %stack.1, 0 :: (store 8)
STRXui %1, %stack.2, 0 :: (store 8)
STRDui %2, %stack.3, 0 :: (store 8)
STRDui %3, %stack.4, 0 :: (store 8)
%4:fpr64 = FMOVDi 20
%5:fpr64 = FADDDrr %2, killed %4
STRDui %5, %stack.5, 0 :: (store 8)
%6:gpr32 = FCVTZSUWDr %5
STRDroW %3, %0, killed %6, 1, 1
%7:gpr64common = LDRXui %stack.1, 0 :: (dereferenceable load 8)
%8:fpr64 = LDRDui %stack.5, 0 :: (dereferenceable load 8)
%9:gpr32common = FCVTZSUWDr killed %8
%10:fpr64 = LDRDroW %7, %9, 1, 1
%11:gpr32common = ADDWri %9, 1, 0
STRDroW killed %10, %7, killed %11, 1, 1
%12:fpr64 = LDRDui %stack.5, 0 :: (dereferenceable load 8)
%13:gpr64common = LDRXui %stack.1, 0 :: (dereferenceable load 8)
%14:gpr32common = FCVTZSUWDr %12
%15:gpr32common = ADDWri killed %14, 30, 0
STRDroW %12, killed %13, killed %15, 1, 1
%16:fpr64 = LDRDui %stack.5, 0 :: (dereferenceable load 8)
STRDui killed %16, %stack.6, 0 :: (store 8)
%19:fpr64 = FMOVDi 112
%46:gpr32 = MOVi32imm 408
%43:fpr64 = LDRDui %stack.5, 0 :: (dereferenceable load 8)
%44:gpr64 = LDRXui %stack.2, 0 :: (dereferenceable load 8)
%45:gpr32 = FCVTZSUWDr %43
%47:gpr64common = SMADDLrrr killed %45, %46, killed %44
%48:fpr64 = LDRDui %stack.6, 0 :: (dereferenceable load 8)
%49:gpr32 = FCVTZSUWDr killed %48
STRDroW %43, killed %47, killed %49, 1, 1
%21:gpr64 = LDRXui %stack.2, 0 :: (dereferenceable load 8)
%22:fpr64 = LDRDui %stack.5, 0 :: (dereferenceable load 8)
%23:gpr32 = FCVTZSUWDr killed %22
%24:gpr32 = MOVi32imm 408
%25:gpr64common = SMADDLrrr %23, %24, killed %21
%26:gpr64sp = ADDXrx killed %25, %23, 51
%27:fpr64 = LDURDi %26, -8
%29:fpr64 = FADDDrr killed %27, %19
STURDi killed %29, %26, -8
%30:gpr64common = LDRXui %stack.1, 0 :: (dereferenceable load 8)
%31:fpr64 = LDRDui %stack.5, 0 :: (dereferenceable load 8)
%32:gpr32common = FCVTZSUWDr killed %31
%34:gpr64all = IMPLICIT_DEF
%33:gpr64 = INSERT_SUBREG %34, %32, %subreg.sub_32
%35:gpr64 = SBFMXri killed %33, 61, 31
%36:fpr64 = LDRDroX killed %30, %35, 0, 0
%37:gpr64 = LDRXui %stack.2, 0 :: (dereferenceable load 8)
%38:gpr32common = ADDWri %32, 20, 0
%39:gpr64common = SMADDLrrr killed %38, %24, killed %37
STRDroX killed %36, killed %39, %35, 0, 0
%40:gpr64 = MOVi64imm 4617315517961601024
%42:gpr32 = LDRWui %stack.0, 0 :: (dereferenceable load 8)
$w0 = COPY %42
RET_ReallyLR implicit $w0
...