brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · bb8eed7 Raw
33 lines · plain
1; RUN: llc %s -mattr=+avx -o - | FileCheck %s2; Originally from http://llvm.org/PR21743.3 4target triple = "x86_64-pc-win32-elf"5 6; Copy propagation may remove COPYs if the result is only used by undef7; operands.8;9; CHECK-LABEL: foo:10; CHECK: movl	$339752784, %e[[INDIRECT_CALL1:[a-z]+]]11; CHECK: callq *%r[[INDIRECT_CALL1]]12; Copy the result in a temporary.13; Note: Technically the regalloc could have been smarter and this move not14; required, which would have hidden the bug.15; CHECK: vmovapd	%xmm0, [[TMP:%xmm[0-9]+]]16; CHECK-NOT: vxorps  %xmm0, %xmm0, %xmm017; CHECK-NEXT: vcvtsi2sd      %rsi, %xmm0, %xmm618; CHECK: movl	$339772768, %e[[INDIRECT_CALL2:[a-z]+]]19; CHECK-NOT: vmovapd %xmm7, %xmm020; CHECK-NEXT: vmovapd %xmm6, %xmm121; Set TMP in the first argument of the second call.22; CHECK-NEXT: callq *%r[[INDIRECT_CALL2]]23; CHECK: retq24define double @foo(i64 %arg) {25top:26  %tmp = call double inttoptr (i64 339752784 to ptr)(double 1.000000e+00, double 0.000000e+00)27  tail call void asm sideeffect "", "x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{dirflag},~{fpsr},~{flags}"(double %tmp)28  %tmp1 = sitofp i64 %arg to double29  call void inttoptr (i64 339772768 to ptr)(double %tmp, double %tmp1)30  %tmp3 = fadd double %tmp1, %tmp31  ret double %tmp332}33