1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 ; Make sure there's no assert on an implicit-def with implicit operands
5 ; during register allocation.
7 %struct.BlockContext = type { [32 x i8], [32 x i8], [2 x [32 x i8]], [32 x i8], [32 x i8], [32 x i8], [32 x i8], [32 x i8], [2 x [32 x i8]], [2 x [32 x i8]], [32 x i8], [32 x i8], [32 x i8], [32 x i8], [16 x i8], [32 x i8], [32 x i8] }
8 %struct.CdfModeContext = type { [4 x [16 x i16]], [2 x [13 x [16 x i16]]], [9 x [16 x i16]], [5 x [4 x [16 x i16]]], [6 x [16 x i16]], [2 x [16 x i16]], [16 x i16], [2 x [13 x [8 x i16]]], [3 x [13 x [8 x i16]]], [8 x i16], [8 x [8 x i16]], [8 x i16], [8 x [8 x i16]], [3 x [8 x i16]], [2 x [7 x [8 x i16]]], [2 x [7 x [5 x [8 x i16]]]], [2 x [8 x [4 x i16]]], [4 x [3 x [4 x i16]]], [22 x [4 x i16]], [4 x i16], [5 x [4 x i16]], [4 x [4 x i16]], [4 x i16], [2 x i16], [2 x i16], [7 x [2 x i16]], [7 x [2 x i16]], [4 x [2 x i16]], [22 x [2 x i16]], [6 x [2 x i16]], [2 x [2 x i16]], [6 x [2 x i16]], [3 x [2 x i16]], [4 x [2 x i16]], [5 x [2 x i16]], [5 x [2 x i16]], [6 x [2 x i16]], [6 x [2 x i16]], [9 x [2 x i16]], [6 x [3 x [2 x i16]]], [3 x [3 x [2 x i16]]], [2 x [3 x [2 x i16]]], [3 x [3 x [2 x i16]]], [7 x [3 x [2 x i16]]], [3 x [2 x i16]], [3 x [2 x i16]], [3 x [2 x i16]], [22 x [2 x i16]], [7 x [3 x [2 x i16]]], [2 x [2 x i16]], [2 x i16], [8 x i8] }
10 define i32 @decode_sb(ptr %t, i32 %bl, i32 %_msprop1966, i32 %sub.i, i64 %idxprom, i1 %cmp54) #0 {
11 ; CHECK-LABEL: decode_sb:
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: pushq %rbp
14 ; CHECK-NEXT: .cfi_def_cfa_offset 16
15 ; CHECK-NEXT: .cfi_offset %rbp, -16
16 ; CHECK-NEXT: movq %rsp, %rbp
17 ; CHECK-NEXT: .cfi_def_cfa_register %rbp
18 ; CHECK-NEXT: pushq %r15
19 ; CHECK-NEXT: pushq %r14
20 ; CHECK-NEXT: pushq %r13
21 ; CHECK-NEXT: pushq %r12
22 ; CHECK-NEXT: pushq %rbx
23 ; CHECK-NEXT: pushq %rax
24 ; CHECK-NEXT: .cfi_offset %rbx, -56
25 ; CHECK-NEXT: .cfi_offset %r12, -48
26 ; CHECK-NEXT: .cfi_offset %r13, -40
27 ; CHECK-NEXT: .cfi_offset %r14, -32
28 ; CHECK-NEXT: .cfi_offset %r15, -24
29 ; CHECK-NEXT: movl %r9d, %ebx
30 ; CHECK-NEXT: # kill: def $edx killed $edx def $rdx
31 ; CHECK-NEXT: movabsq $87960930222080, %r15 # imm = 0x500000000000
32 ; CHECK-NEXT: movl 0, %r11d
33 ; CHECK-NEXT: movl %esi, %r12d
34 ; CHECK-NEXT: # implicit-def: $r13d
35 ; CHECK-NEXT: testb $1, %bl
36 ; CHECK-NEXT: jne .LBB0_7
37 ; CHECK-NEXT: # %bb.1: # %if.else
38 ; CHECK-NEXT: movq %r8, %r14
39 ; CHECK-NEXT: movl %ecx, %r13d
40 ; CHECK-NEXT: andl $1, %r13d
41 ; CHECK-NEXT: movzbl 544(%r13), %r8d
42 ; CHECK-NEXT: andl $1, %r8d
43 ; CHECK-NEXT: movl %r15d, %r9d
44 ; CHECK-NEXT: andl $1, %r9d
45 ; CHECK-NEXT: movl %r14d, %r10d
46 ; CHECK-NEXT: andl $1, %r10d
47 ; CHECK-NEXT: movabsq $17592186044416, %rax # imm = 0x100000000000
48 ; CHECK-NEXT: orq %r10, %rax
49 ; CHECK-NEXT: movl %esi, %r10d
50 ; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
51 ; CHECK-NEXT: shrl %cl, %r10d
52 ; CHECK-NEXT: andl $2, %r10d
53 ; CHECK-NEXT: testb $1, %bl
54 ; CHECK-NEXT: cmoveq %r9, %rax
55 ; CHECK-NEXT: orl %r8d, %edx
56 ; CHECK-NEXT: movq %r11, {{[-0-9]+}}(%r{{[sb]}}p) # 8-byte Spill
57 ; CHECK-NEXT: movq %r11, %rcx
58 ; CHECK-NEXT: orq $1, %rcx
59 ; CHECK-NEXT: orl %esi, %r10d
60 ; CHECK-NEXT: movl $1, %r8d
61 ; CHECK-NEXT: je .LBB0_3
62 ; CHECK-NEXT: # %bb.2: # %if.else
63 ; CHECK-NEXT: movl (%rax), %r8d
64 ; CHECK-NEXT: .LBB0_3: # %if.else
65 ; CHECK-NEXT: shlq $5, %rdx
66 ; CHECK-NEXT: movq %r12, %rax
67 ; CHECK-NEXT: shlq $7, %rax
68 ; CHECK-NEXT: leaq (%rax,%rdx), %rsi
69 ; CHECK-NEXT: addq $1248, %rsi # imm = 0x4E0
70 ; CHECK-NEXT: movq %rcx, 0
71 ; CHECK-NEXT: movq %rdi, %r15
72 ; CHECK-NEXT: movl %r8d, (%rdi)
73 ; CHECK-NEXT: xorl %eax, %eax
74 ; CHECK-NEXT: xorl %edi, %edi
75 ; CHECK-NEXT: xorl %edx, %edx
76 ; CHECK-NEXT: callq *%rax
77 ; CHECK-NEXT: xorq $1, %r14
78 ; CHECK-NEXT: cmpl $0, (%r14)
79 ; CHECK-NEXT: je .LBB0_6
80 ; CHECK-NEXT: # %bb.4: # %if.else
81 ; CHECK-NEXT: movb $1, %al
82 ; CHECK-NEXT: testb %al, %al
83 ; CHECK-NEXT: je .LBB0_5
84 ; CHECK-NEXT: .LBB0_6: # %bb19
85 ; CHECK-NEXT: testb $1, %bl
86 ; CHECK-NEXT: movq %r15, %rdi
87 ; CHECK-NEXT: movabsq $87960930222080, %r15 # imm = 0x500000000000
88 ; CHECK-NEXT: movq {{[-0-9]+}}(%r{{[sb]}}p), %r11 # 8-byte Reload
89 ; CHECK-NEXT: jne .LBB0_8
90 ; CHECK-NEXT: .LBB0_7: # %if.end69
91 ; CHECK-NEXT: movl %r11d, 0
92 ; CHECK-NEXT: xorl %eax, %eax
93 ; CHECK-NEXT: xorl %esi, %esi
94 ; CHECK-NEXT: xorl %edx, %edx
95 ; CHECK-NEXT: xorl %ecx, %ecx
96 ; CHECK-NEXT: xorl %r8d, %r8d
97 ; CHECK-NEXT: callq *%rax
98 ; CHECK-NEXT: xorq %r15, %r12
99 ; CHECK-NEXT: movslq %r13d, %rax
100 ; CHECK-NEXT: movzbl (%r12), %ecx
101 ; CHECK-NEXT: movb %cl, 544(%rax)
102 ; CHECK-NEXT: .LBB0_8: # %land.lhs.true56
103 ; CHECK-NEXT: xorl %eax, %eax
104 ; CHECK-NEXT: addq $8, %rsp
105 ; CHECK-NEXT: popq %rbx
106 ; CHECK-NEXT: popq %r12
107 ; CHECK-NEXT: popq %r13
108 ; CHECK-NEXT: popq %r14
109 ; CHECK-NEXT: popq %r15
110 ; CHECK-NEXT: popq %rbp
111 ; CHECK-NEXT: .cfi_def_cfa %rsp, 8
113 ; CHECK-NEXT: .LBB0_5: # %bb
115 %i = load i32, ptr null, align 8
116 br i1 %cmp54, label %if.end69, label %if.else
118 if.else: ; preds = %entry
119 %shr18 = and i32 %sub.i, 1
120 %idxprom.i = zext i32 %shr18 to i64
121 %arrayidx.i = getelementptr %struct.BlockContext, ptr null, i64 0, i32 14, i64 %idxprom.i
122 %i1 = load i8, ptr %arrayidx.i, align 1
123 %conv.i = zext i8 %i1 to i32
124 %and.i = and i32 %conv.i, 1
125 %i2 = and i64 87960930222080, 1
126 %i3 = inttoptr i64 %i2 to ptr
127 %i4 = load i32, ptr %i3, align 4
128 %i5 = and i64 %idxprom, 1
129 %i6 = or i64 %i5, 17592186044416
130 %i7 = inttoptr i64 %i6 to ptr
131 %i8 = load i32, ptr %i7, align 4
132 %i9 = lshr i32 %bl, %sub.i
133 %i10 = and i32 %i9, 2
134 %i11 = or i32 %bl, %i10
135 %i12 = select i1 %cmp54, i32 %i8, i32 %i4
136 %add.i = or i32 %_msprop1966, %and.i
137 %idxprom4 = zext i32 %bl to i64
138 %idxprom24 = zext i32 %add.i to i64
140 %i14 = zext i32 %i13 to i64
141 %.not2329 = icmp eq i32 %i11, 0
142 %i15 = select i1 %.not2329, i32 1, i32 %i12
143 %arrayidx25 = getelementptr %struct.CdfModeContext, ptr null, i64 0, i32 3, i64 %idxprom4, i64 %idxprom24
144 store i64 %i14, ptr null, align 8
145 store i32 %i15, ptr %t, align 4
146 %call53 = tail call i32 null(ptr null, ptr %arrayidx25, i64 0)
147 %i16 = xor i64 %idxprom, 1
148 %i17 = inttoptr i64 %i16 to ptr
149 %_msld1992 = load i32, ptr %i17, align 8
150 %i18 = icmp ne i32 %_msld1992, 0
151 %_msprop_icmp1993 = and i1 %i18, false
152 br i1 %_msprop_icmp1993, label %bb, label %bb19
154 bb: ; preds = %if.else
157 bb19: ; preds = %if.else
158 br i1 %cmp54, label %land.lhs.true56, label %if.end69
160 land.lhs.true56: ; preds = %bb19
163 if.end69: ; preds = %bb19, %entry
164 %bx8.011941201 = phi i32 [ %shr18, %bb19 ], [ undef, %entry ]
165 store i32 %i, ptr null, align 8
166 %call79 = tail call fastcc i32 null(ptr %t, i32 0, i32 0, i32 0, i32 0)
167 %idxprom666 = zext i32 %bl to i64
168 %i20 = xor i64 %idxprom666, 87960930222080
169 %idxprom675 = sext i32 %bx8.011941201 to i64
170 %arrayidx676 = getelementptr %struct.BlockContext, ptr null, i64 0, i32 14, i64 %idxprom675
171 %i21 = inttoptr i64 %i20 to ptr
172 %_msld1414 = load i8, ptr %i21, align 1
173 store i8 %_msld1414, ptr %arrayidx676, align 1
177 attributes #0 = { "frame-pointer"="all" "target-cpu"="x86-64" }