Skip to content

Commit 69ddf1e

Browse files
committed
[X86] Add test for #80911 (NFC)
1 parent c9afeaa commit 69ddf1e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

llvm/test/CodeGen/X86/load-combine.ll

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,3 +1282,36 @@ define i32 @zext_load_i32_by_i8_bswap_shl_16(ptr %arg) {
12821282
%tmp8 = or i32 %tmp7, %tmp30
12831283
ret i32 %tmp8
12841284
}
1285+
1286+
; FIXME: This is a miscompile.
1287+
define i32 @pr80911_vector_load_multiuse(ptr %ptr, ptr %clobber) nounwind {
1288+
; CHECK-LABEL: pr80911_vector_load_multiuse:
1289+
; CHECK: # %bb.0:
1290+
; CHECK-NEXT: pushl %esi
1291+
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
1292+
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
1293+
; CHECK-NEXT: movl (%edx), %esi
1294+
; CHECK-NEXT: movzwl (%edx), %eax
1295+
; CHECK-NEXT: movl $0, (%ecx)
1296+
; CHECK-NEXT: movl %esi, (%edx)
1297+
; CHECK-NEXT: popl %esi
1298+
; CHECK-NEXT: retl
1299+
;
1300+
; CHECK64-LABEL: pr80911_vector_load_multiuse:
1301+
; CHECK64: # %bb.0:
1302+
; CHECK64-NEXT: movzwl (%rdi), %eax
1303+
; CHECK64-NEXT: movl $0, (%rsi)
1304+
; CHECK64-NEXT: movl (%rdi), %ecx
1305+
; CHECK64-NEXT: movl %ecx, (%rdi)
1306+
; CHECK64-NEXT: retq
1307+
%load = load <4 x i8>, ptr %ptr, align 16
1308+
store i32 0, ptr %clobber
1309+
store <4 x i8> %load, ptr %ptr, align 16
1310+
%e1 = extractelement <4 x i8> %load, i64 1
1311+
%e1.ext = zext i8 %e1 to i32
1312+
%e1.ext.shift = shl nuw nsw i32 %e1.ext, 8
1313+
%e0 = extractelement <4 x i8> %load, i64 0
1314+
%e0.ext = zext i8 %e0 to i32
1315+
%res = or i32 %e1.ext.shift, %e0.ext
1316+
ret i32 %res
1317+
}

0 commit comments

Comments
 (0)