brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 716a93a Raw
44 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -fast-isel -O1 | FileCheck %s3 4; This used to crash due to the bitcast in the entry block reusing the vreg5; from its input. This resulted in known bits being calculated on the v2i646; type. But the second basic block tried to use them with a v8i16 type. This7; was fixed by emitting a reg-reg copy for the bitcast so the vreg type will8; be seen the same in both basic blocks.9 10; We need the entry block to fall out of fast isel after selecting the bitcast.11; The shuffle vector guarantees that. The zext gives us a useful known bits12; value. We also need the second basic block to fall out of fast isel which the13; intrinsic guarantees.14 15define <8 x i16> @bitcast_crash(i32 %arg, <8 x i16> %x, i1 %c) {16; CHECK-LABEL: bitcast_crash:17; CHECK:       # %bb.0: # %bb18; CHECK-NEXT:    movd %edi, %xmm119; CHECK-NEXT:    pshufd {{.*#+}} xmm1 = xmm1[0,1,0,1]20; CHECK-NEXT:    testb $1, %sil21; CHECK-NEXT:    je .LBB0_222; CHECK-NEXT:  # %bb.1: # %bb123; CHECK-NEXT:    psraw %xmm1, %xmm024; CHECK-NEXT:    retq25; CHECK-NEXT:  .LBB0_2: # %bb226; CHECK-NEXT:    movdqa %xmm1, %xmm027; CHECK-NEXT:    retq28bb:29  %tmp = zext i32 %arg to i6430  %tmp1 = insertelement <2 x i64> undef, i64 %tmp, i32 031  %tmp2 = shufflevector <2 x i64> %tmp1, <2 x i64> undef, <2 x i32> zeroinitializer32  %tmp5 = bitcast <2 x i64> %tmp2 to <8 x i16>33  br i1 %c, label %bb1, label %bb234 35bb1:                                              ; preds = %bb8, %bb636  %tmp9 = call <8 x i16> @llvm.x86.sse2.psra.w(<8 x i16> %x, <8 x i16> %tmp5)37  ret <8 x i16> %tmp938 39bb2:40  ret <8 x i16> %tmp541}42 43declare <8 x i16> @llvm.x86.sse2.psra.w(<8 x i16>, <8 x i16>)44