1; RUN: llc < %s -march=x86 | FileCheck %s -check-prefix=X32 2; RUN: llc < %s -march=x86-64 | FileCheck %s -check-prefix=X64 3 4; DAGCombiner crashes during sext folding 5 6define <2 x i256> @test_sext1() { 7 %Se = sext <2 x i8> <i8 -100, i8 -99> to <2 x i256> 8 %Shuff = shufflevector <2 x i256> zeroinitializer, <2 x i256> %Se, <2 x i32> <i32 1, i32 3> 9 ret <2 x i256> %Shuff 10 11 ; X64-LABEL: test_sext1 12 ; X64: movq $-1 13 ; X64-NEXT: movq $-1 14 ; X64-NEXT: movq $-1 15 ; X64-NEXT: movq $-99 16 17 ; X32-LABEL: test_sext1 18 ; X32: movl $-1 19 ; X32-NEXT: movl $-1 20 ; X32-NEXT: movl $-1 21 ; X32-NEXT: movl $-1 22 ; X32-NEXT: movl $-1 23 ; X32-NEXT: movl $-1 24 ; X32-NEXT: movl $-1 25 ; X32-NEXT: movl $-99 26} 27 28define <2 x i256> @test_sext2() { 29 %Se = sext <2 x i128> <i128 -2000, i128 -1999> to <2 x i256> 30 %Shuff = shufflevector <2 x i256> zeroinitializer, <2 x i256> %Se, <2 x i32> <i32 1, i32 3> 31 ret <2 x i256> %Shuff 32 33 ; X64-LABEL: test_sext2 34 ; X64: movq $-1 35 ; X64-NEXT: movq $-1 36 ; X64-NEXT: movq $-1 37 ; X64-NEXT: movq $-1999 38 39 ; X32-LABEL: test_sext2 40 ; X32: movl $-1 41 ; X32-NEXT: movl $-1 42 ; X32-NEXT: movl $-1 43 ; X32-NEXT: movl $-1 44 ; X32-NEXT: movl $-1 45 ; X32-NEXT: movl $-1 46 ; X32-NEXT: movl $-1 47 ; X32-NEXT: movl $-1999 48} 49 50define <2 x i256> @test_zext1() { 51 %Se = zext <2 x i8> <i8 -1, i8 -2> to <2 x i256> 52 %Shuff = shufflevector <2 x i256> zeroinitializer, <2 x i256> %Se, <2 x i32> <i32 1, i32 3> 53 ret <2 x i256> %Shuff 54 55 ; X64-LABEL: test_zext1 56 ; X64: movq $0 57 ; X64-NEXT: movq $0 58 ; X64-NEXT: movq $0 59 ; X64-NEXT: movq $254 60 61 ; X32-LABEL: test_zext1 62 ; X32: movl $0 63 ; X32-NEXT: movl $0 64 ; X32-NEXT: movl $0 65 ; X32-NEXT: movl $0 66 ; X32-NEXT: movl $0 67 ; X32-NEXT: movl $0 68 ; X32-NEXT: movl $0 69 ; X32-NEXT: movl $254 70} 71 72define <2 x i256> @test_zext2() { 73 %Se = zext <2 x i128> <i128 -1, i128 -2> to <2 x i256> 74 %Shuff = shufflevector <2 x i256> zeroinitializer, <2 x i256> %Se, <2 x i32> <i32 1, i32 3> 75 ret <2 x i256> %Shuff 76 77 ; X64-LABEL: test_zext2 78 ; X64: movq $0 79 ; X64-NEXT: movq $0 80 ; X64-NEXT: movq $-1 81 ; X64-NEXT: movq $-2 82 83 ; X32-LABEL: test_zext2 84 ; X32: movl $0 85 ; X32-NEXT: movl $0 86 ; X32-NEXT: movl $0 87 ; X32-NEXT: movl $0 88 ; X32-NEXT: movl $-1 89 ; X32-NEXT: movl $-1 90 ; X32-NEXT: movl $-1 91 ; X32-NEXT: movl $-2 92} 93