Skip to content

Commit 150e7b1

Browse files
committed
[X86] Add test coverage for #134602
1 parent 893cd69 commit 150e7b1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

llvm/test/CodeGen/X86/pr134602.ll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=i686-- | FileCheck %s --check-prefix=X86
3+
; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s --check-prefix=X64
4+
5+
; FIXME: incorrect vector codegen due to bad handling of splats of binops containing undefs
6+
define i32 @PR134602(i16 %a0) {
7+
; X86-LABEL: PR134602:
8+
; X86: # %bb.0:
9+
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
10+
; X86-NEXT: orl $1, %eax
11+
; X86-NEXT: addl $3, %eax
12+
; X86-NEXT: cwtl
13+
; X86-NEXT: retl
14+
;
15+
; X64-LABEL: PR134602:
16+
; X64: # %bb.0:
17+
; X64-NEXT: xorl %eax, %eax
18+
; X64-NEXT: retq
19+
%splat= insertelement <4 x i16> zeroinitializer, i16 %a0, i64 0
20+
%mul = mul <4 x i16> %splat, <i16 1, i16 1, i16 0, i16 0>
21+
%or = or <4 x i16> splat (i16 1), %mul
22+
%reduce = call i16 @llvm.vector.reduce.add.v4i16(<4 x i16> %or)
23+
%ret_32 = sext i16 %reduce to i32
24+
ret i32 %ret_32
25+
}

0 commit comments

Comments
 (0)