From 54c20b559e83c75a6f347b3043e478b07b772042 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 17 Jan 2008 02:08:17 +0000 Subject: When a live virtual register is being clobbered by an implicit def, it is spilled and the spill is its kill. However, if the local allocator has determined the register has not been modified (possible when its value was reloaded), it would not issue a restore. In that case, mark the last use of the virtual register as kill. llvm-svn: 46111 --- .../CodeGen/X86/2008-01-16-FPStackifierAssert.ll | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 llvm/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll (limited to 'llvm/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll') diff --git a/llvm/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll b/llvm/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll new file mode 100644 index 00000000000..83ca3e3ac72 --- /dev/null +++ b/llvm/test/CodeGen/X86/2008-01-16-FPStackifierAssert.ll @@ -0,0 +1,35 @@ +; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 -regalloc=local + +define void @SolveCubic(double %a, double %b, double %c, double %d, i32* %solutions, double* %x) { +entry: + %tmp71 = load x86_fp80* null, align 16 ; [#uses=1] + %tmp72 = fdiv x86_fp80 %tmp71, 0xKC000C000000000000000 ; [#uses=1] + %tmp73 = add x86_fp80 0xK00000000000000000000, %tmp72 ; [#uses=1] + %tmp7374 = fptrunc x86_fp80 %tmp73 to double ; [#uses=1] + store double %tmp7374, double* null, align 8 + %tmp81 = load double* null, align 8 ; [#uses=1] + %tmp82 = add double %tmp81, 0x401921FB54442D18 ; [#uses=1] + %tmp83 = fdiv double %tmp82, 3.000000e+00 ; [#uses=1] + %tmp84 = call double @cos( double %tmp83 ) ; [#uses=1] + %tmp85 = mul double 0.000000e+00, %tmp84 ; [#uses=1] + %tmp8586 = fpext double %tmp85 to x86_fp80 ; [#uses=1] + %tmp87 = load x86_fp80* null, align 16 ; [#uses=1] + %tmp88 = fdiv x86_fp80 %tmp87, 0xKC000C000000000000000 ; [#uses=1] + %tmp89 = add x86_fp80 %tmp8586, %tmp88 ; [#uses=1] + %tmp8990 = fptrunc x86_fp80 %tmp89 to double ; [#uses=1] + store double %tmp8990, double* null, align 8 + %tmp97 = load double* null, align 8 ; [#uses=1] + %tmp98 = add double %tmp97, 0x402921FB54442D18 ; [#uses=1] + %tmp99 = fdiv double %tmp98, 3.000000e+00 ; [#uses=1] + %tmp100 = call double @cos( double %tmp99 ) ; [#uses=1] + %tmp101 = mul double 0.000000e+00, %tmp100 ; [#uses=1] + %tmp101102 = fpext double %tmp101 to x86_fp80 ; [#uses=1] + %tmp103 = load x86_fp80* null, align 16 ; [#uses=1] + %tmp104 = fdiv x86_fp80 %tmp103, 0xKC000C000000000000000 ; [#uses=1] + %tmp105 = add x86_fp80 %tmp101102, %tmp104 ; [#uses=1] + %tmp105106 = fptrunc x86_fp80 %tmp105 to double ; [#uses=1] + store double %tmp105106, double* null, align 8 + ret void +} + +declare double @cos(double) -- cgit v1.2.3