brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 8306daf Raw
70 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mattr=+sse2 | FileCheck %s3; PR26564 5target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"6target triple = "i686-apple-darwin9.4.0"7 8%struct.anon = type <{ float, float }>9@.str = internal constant [17 x i8] c"pt: %.0f, %.0f\0A\00\00"		; <ptr> [#uses=1]10 11; We can not fold either stack load into an 'xor' instruction because that12; would change what should be a 4-byte load into a 16-byte load.13; We can fold the 16-byte constant load into either 'xor' instruction,14; but we do not. It has more than one use, so it gets loaded into a register.15 16define void @foo(ptr byval(%struct.anon) %p) nounwind {17; CHECK-LABEL: foo:18; CHECK:       ## %bb.0: ## %entry19; CHECK-NEXT:    subl $28, %esp20; CHECK-NEXT:    movaps {{.*#+}} xmm0 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]21; CHECK-NEXT:    movss {{.*#+}} xmm1 = mem[0],zero,zero,zero22; CHECK-NEXT:    movss {{.*#+}} xmm2 = mem[0],zero,zero,zero23; CHECK-NEXT:    xorps %xmm0, %xmm124; CHECK-NEXT:    cvtss2sd %xmm1, %xmm125; CHECK-NEXT:    xorps %xmm0, %xmm226; CHECK-NEXT:    xorps %xmm0, %xmm027; CHECK-NEXT:    cvtss2sd %xmm2, %xmm028; CHECK-NEXT:    movsd %xmm0, {{[0-9]+}}(%esp)29; CHECK-NEXT:    movsd %xmm1, {{[0-9]+}}(%esp)30; CHECK-NEXT:    movl $_.str, (%esp)31; CHECK-NEXT:    calll _printf32; CHECK-NEXT:    addl $28, %esp33; CHECK-NEXT:    retl34entry:35	%tmp = getelementptr %struct.anon, ptr %p, i32 0, i32 0		; <ptr> [#uses=1]36	%tmp1 = load float, ptr %tmp		; <float> [#uses=1]37	%tmp2 = getelementptr %struct.anon, ptr %p, i32 0, i32 1		; <ptr> [#uses=1]38	%tmp3 = load float, ptr %tmp2		; <float> [#uses=1]39	%neg = fsub float -0.000000e+00, %tmp1		; <float> [#uses=1]40	%conv = fpext float %neg to double		; <double> [#uses=1]41	%neg4 = fsub float -0.000000e+00, %tmp3		; <float> [#uses=1]42	%conv5 = fpext float %neg4 to double		; <double> [#uses=1]43	%call = call i32 (...) @printf( ptr @.str, double %conv, double %conv5 )		; <i32> [#uses=0]44	ret void45}46 47declare i32 @printf(...)48 49; We can not fold the load from the stack into the 'and' instruction because50; that changes an 8-byte load into a 16-byte load (illegal memory access).51; We can fold the load of the constant because it is a 16-byte vector constant.52 53define double @PR22371(double %x) {54; CHECK-LABEL: PR22371:55; CHECK:       ## %bb.0:56; CHECK-NEXT:    subl $12, %esp57; CHECK-NEXT:    .cfi_def_cfa_offset 1658; CHECK-NEXT:    movsd {{.*#+}} xmm0 = mem[0],zero59; CHECK-NEXT:    andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm060; CHECK-NEXT:    movlps %xmm0, (%esp)61; CHECK-NEXT:    fldl (%esp)62; CHECK-NEXT:    addl $12, %esp63; CHECK-NEXT:    retl64  %call = tail call double @fabs(double %x) #065  ret double %call66}67 68declare double @fabs(double) #069attributes #0 = { readnone }70