brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 4740bf5 Raw
73 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -disable-peephole -mtriple=x86_64-unknown -mattr=+sse4.1,-slow-unaligned-mem-16 | FileCheck %s3 4define <8 x i16> @commute_fold_pblendw(<8 x i16> %a, ptr %b) {5; CHECK-LABEL: commute_fold_pblendw:6; CHECK:       # %bb.0:7; CHECK-NEXT:    pblendw {{.*#+}} xmm0 = xmm0[0],mem[1,2,3],xmm0[4],mem[5,6,7]8; CHECK-NEXT:    retq9  %1 = load <8 x i16>, ptr %b10  %2 = call <8 x i16> @llvm.x86.sse41.pblendw(<8 x i16> %1, <8 x i16> %a, i8 17)11  ret <8 x i16> %212}13declare <8 x i16> @llvm.x86.sse41.pblendw(<8 x i16>, <8 x i16>, i8) nounwind readnone14 15define <4 x float> @commute_fold_blendps(<4 x float> %a, ptr %b) {16; CHECK-LABEL: commute_fold_blendps:17; CHECK:       # %bb.0:18; CHECK-NEXT:    blendps {{.*#+}} xmm0 = xmm0[0],mem[1],xmm0[2],mem[3]19; CHECK-NEXT:    retq20  %1 = load <4 x float>, ptr %b21  %2 = call <4 x float> @llvm.x86.sse41.blendps(<4 x float> %1, <4 x float> %a, i8 5)22  ret <4 x float> %223}24declare <4 x float> @llvm.x86.sse41.blendps(<4 x float>, <4 x float>, i8) nounwind readnone25 26define <2 x double> @commute_fold_blendpd(<2 x double> %a, ptr %b) {27; CHECK-LABEL: commute_fold_blendpd:28; CHECK:       # %bb.0:29; CHECK-NEXT:    blendps {{.*#+}} xmm0 = xmm0[0,1],mem[2,3]30; CHECK-NEXT:    retq31  %1 = load <2 x double>, ptr %b32  %2 = call <2 x double> @llvm.x86.sse41.blendpd(<2 x double> %1, <2 x double> %a, i8 1)33  ret <2 x double> %234}35declare <2 x double> @llvm.x86.sse41.blendpd(<2 x double>, <2 x double>, i8) nounwind readnone36 37define <4 x i32> @commute_fold_blend_v4i32(ptr %a, <4 x i32> %b) {38; CHECK-LABEL: commute_fold_blend_v4i32:39; CHECK:       # %bb.0:40; CHECK-NEXT:    paddd %xmm0, %xmm041; CHECK-NEXT:    pblendw {{.*#+}} xmm0 = mem[0,1,2,3,4,5],xmm0[6,7]42; CHECK-NEXT:    retq43  %1 = load <4 x i32>, ptr %a44  %2 = add <4 x i32> %b, %b ; force integer domain45  %3 = shufflevector <4 x i32> %1, <4 x i32> %2, <4 x i32> <i32 0, i32 1, i32 2, i32 7>46  ret <4 x i32> %347}48 49; Test case for a crash that occurred due to blendi being commuted to50; movsd during two address instruction pass. The change in number of operands51; caused a bad call to getOperand. This caused the revert in r354713.52%struct.spam = type { i64, i64 }53 54define void @baz(ptr %arg, ptr %arg1) optsize {55; CHECK-LABEL: baz:56; CHECK:       # %bb.0: # %bb57; CHECK-NEXT:    movaps (%rdi), %xmm058; CHECK-NEXT:    movaps {{.*#+}} xmm1 = [3,3]59; CHECK-NEXT:    andps %xmm0, %xmm160; CHECK-NEXT:    movsd {{.*#+}} xmm1 = xmm0[0],xmm1[1]61; CHECK-NEXT:    movups %xmm1, (%rsi)62; CHECK-NEXT:    retq63bb:64  %tmp = load <2 x i64>, ptr %arg, align 1665  %tmp2 = and <2 x i64> %tmp, <i64 3, i64 3>66  %tmp4 = extractelement <2 x i64> %tmp, i32 067  store i64 %tmp4, ptr %arg1, align 868  %tmp5 = getelementptr inbounds %struct.spam, ptr %arg1, i64 0, i32 169  %tmp6 = extractelement <2 x i64> %tmp2, i32 170  store i64 %tmp6, ptr %tmp5, align 871  ret void72}73