1
+ # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
1
2
# RUN: llc -mtriple x86_64-unknown-unknown -x mir < %s \
2
- # RUN: -verify-machineinstrs -enable-subreg-liveness=true \
3
+ # RUN: -verify-coalescing -enable-subreg-liveness=true \
3
4
# RUN: --run-pass=register-coalescer -o - | FileCheck %s
4
5
5
- --- |
6
- target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
7
- target triple = "x86_64-unknown-unknown"
8
-
9
- %pair = type { i64, double }
10
- %t21 = type { ptr }
11
- %t13 = type { ptr, %t15, %t15 }
12
- %t15 = type { i8, i32, i32 }
13
-
14
- @__force_order = external hidden global i32, align 4
15
- @.str = private unnamed_addr constant { [1 x i8], [63 x i8] } zeroinitializer, align 32
16
- @a = external global i32, align 4
17
- @fn1.g = private unnamed_addr constant [9 x ptr] [ptr null, ptr @a, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null, ptr null], align 16
18
- @e = external global i32, align 4
19
- @__stack_chk_guard = external dso_local global ptr
20
-
21
- ; Function Attrs : nounwind ssp
22
- define i32 @test1() # 0 {
23
- entry :
24
- %tmp5.i = load volatile i32, ptr undef, align 4
25
- %conv.i = zext i32 %tmp5.i to i64
26
- %tmp12.i = load volatile i32, ptr undef, align 4
27
- %conv13.i = zext i32 %tmp12.i to i64
28
- %shl.i = shl i64 %conv13.i, 32
29
- %or.i = or i64 %shl.i, %conv.i
30
- %add16.i = add i64 %or.i, 256
31
- %shr.i = lshr i64 %add16.i, 8
32
- %conv19.i = trunc i64 %shr.i to i32
33
- store volatile i32 %conv19.i, ptr undef, align 4
34
- ret i32 undef
35
- }
36
- ...
37
6
---
38
7
name : test1
39
8
alignment : 16
40
- exposesReturnsTwice : false
41
- legalized : false
42
- regBankSelected : false
43
- selected : false
44
- failedISel : false
45
9
tracksRegLiveness : true
46
- hasWinCFI : false
47
- callsEHReturn : false
48
- callsUnwindInit : false
49
- hasEHCatchret : false
50
- hasEHScopes : false
51
- hasEHFunclets : false
52
- isOutlined : false
53
- debugInstrRef : true
54
- failsVerification : false
55
- tracksDebugUserValues : false
56
- registers :
57
- - { id: 0, class: gr32, preferred-register: '' }
58
- - { id: 1, class: gr64, preferred-register: '' }
59
- - { id: 2, class: gr64_nosp, preferred-register: '' }
60
- - { id: 3, class: gr32, preferred-register: '' }
61
- - { id: 4, class: gr64, preferred-register: '' }
62
- - { id: 5, class: gr64, preferred-register: '' }
63
- - { id: 6, class: gr64, preferred-register: '' }
64
- - { id: 7, class: gr64, preferred-register: '' }
65
- - { id: 8, class: gr64, preferred-register: '' }
66
- - { id: 9, class: gr32, preferred-register: '' }
67
- - { id: 10, class: gr64, preferred-register: '' }
68
- - { id: 11, class: gr32, preferred-register: '' }
69
- liveins : []
70
- frameInfo :
71
- isFrameAddressTaken : false
72
- isReturnAddressTaken : false
73
- hasStackMap : false
74
- hasPatchPoint : false
75
- stackSize : 0
76
- offsetAdjustment : 0
77
- maxAlignment : 1
78
- adjustsStack : false
79
- hasCalls : false
80
- stackProtector : ' '
81
- functionContext : ' '
82
- maxCallFrameSize : 4294967295
83
- cvBytesOfCalleeSavedRegisters : 0
84
- hasOpaqueSPAdjustment : false
85
- hasVAStart : false
86
- hasMustTailInVarArgFunc : false
87
- hasTailCall : false
88
- isCalleeSavedInfoValid : false
89
- localFrameSize : 0
90
- savePoint : ' '
91
- restorePoint : ' '
92
- fixedStack : []
93
- stack : []
94
- entry_values : []
95
- callSites : []
96
- debugValueSubstitutions : []
97
- constants : []
98
- machineFunctionInfo :
99
- amxProgModel : None
100
10
body : |
101
- bb.0.entry:
11
+ bb.0:
12
+ ; CHECK-LABEL: name: test1
13
+ ; CHECK: undef [[MOV32rm:%[0-9]+]].sub_32bit:gr64_nosp = MOV32rm undef %1:gr64, 1, $noreg, 0, $noreg :: (volatile load (s32) from `ptr undef`)
14
+ ; CHECK-NEXT: undef [[MOV32rm1:%[0-9]+]].sub_32bit:gr64_with_sub_8bit = MOV32rm undef %4:gr64, 1, $noreg, 0, $noreg :: (volatile load (s32) from `ptr undef`)
15
+ ; CHECK-NEXT: [[MOV32rm1:%[0-9]+]]:gr64_with_sub_8bit = SHL64ri [[MOV32rm1]], 32, implicit-def dead $eflags
16
+ ; CHECK-NEXT: [[LEA64r:%[0-9]+]]:gr64_with_sub_8bit = LEA64r [[MOV32rm1]], 1, [[MOV32rm]], 256, $noreg
17
+ ; CHECK-NEXT: [[LEA64r:%[0-9]+]]:gr64_with_sub_8bit = SHR64ri [[LEA64r]], 8, implicit-def dead $eflags
18
+ ; CHECK-NEXT: MOV32mr undef %10:gr64, 1, $noreg, 0, $noreg, [[LEA64r]].sub_32bit :: (volatile store (s32) into `ptr undef`)
19
+ ; CHECK-NEXT: RET 0, undef $eax
102
20
%0:gr32 = MOV32rm undef %1:gr64, 1, $noreg, 0, $noreg :: (volatile load (s32) from `ptr undef`)
103
21
%2:gr64_nosp = SUBREG_TO_REG 0, killed %0, %subreg.sub_32bit
104
22
%3:gr32 = MOV32rm undef %4:gr64, 1, $noreg, 0, $noreg :: (volatile load (s32) from `ptr undef`)
@@ -113,12 +31,3 @@ body: |
113
31
RET 0, undef $eax
114
32
115
33
...
116
-
117
- # CHECK: undef %2.sub_32bit:gr64_nosp = MOV32rm undef %1:gr64, 1, $noreg, 0, $noreg :: (volatile load (s32) from `ptr undef`)
118
- # CHECK-NEXT: undef %6.sub_32bit:gr64_with_sub_8bit = MOV32rm undef %4:gr64, 1, $noreg, 0, $noreg :: (volatile load (s32) from `ptr undef`)
119
- # CHECK-NEXT: %6:gr64_with_sub_8bit = SHL64ri %6, 32, implicit-def dead $eflags
120
- # CHECK-NEXT: %8:gr64_with_sub_8bit = LEA64r %6, 1, %2, 256, $noreg
121
- # CHECK-NEXT: %8:gr64_with_sub_8bit = SHR64ri %8, 8, implicit-def dead $eflags
122
- # CHECK-NEXT: MOV32mr undef %10:gr64, 1, $noreg, 0, $noreg, %8.sub_32bit :: (volatile store (s32) into `ptr undef`)
123
- # CHECK-NEXT: RET 0, undef $eax
124
-
0 commit comments