[llvm-commits] [llvm] r62572 - /llvm/trunk/test/CodeGen/X86/limited-prec.ll

Chris Lattner clattner at apple.com
Tue Jan 20 22:39:11 PST 2009


On Jan 19, 2009, at 10:24 PM, Bill Wendling wrote:

> Author: void
> Date: Tue Jan 20 00:23:59 2009
> New Revision: 62572
>
> URL: http://llvm.org/viewvc/llvm-project?rev=62572&view=rev
> Log:
> Testcase for limited precision stuff.

Hi Bill, please run the testcase through simplifycfg + mem2reg to  
clean it up, unless you really want the unoptimized code.

-Chris

>
>
> Added:
>    llvm/trunk/test/CodeGen/X86/limited-prec.ll
>
> Added: llvm/trunk/test/CodeGen/X86/limited-prec.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/limited-prec.ll?rev=62572&view=auto
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/test/CodeGen/X86/limited-prec.ll (added)
> +++ llvm/trunk/test/CodeGen/X86/limited-prec.ll Tue Jan 20 00:23:59  
> 2009
> @@ -0,0 +1,133 @@
> +; RUN: llvm-as < %s | llc -limit-float-precision=6 -march=x86 | \
> +; RUN:    not grep exp | not grep log | not grep pow
> +; RUN: llvm-as < %s | llc -limit-float-precision=12 -march=x86 | \
> +; RUN:    not grep exp | not grep log | not grep pow
> +; RUN: llvm-as < %s | llc -limit-float-precision=18 -march=x86 | \
> +; RUN:    not grep exp | not grep log | not grep pow
> +target triple = "i386-apple-darwin9.5"
> +
> +define float @f1(float %x) nounwind noinline {
> +entry:
> +	%x_addr = alloca float		; <float*> [#uses=2]
> +	%retval = alloca float		; <float*> [#uses=2]
> +	%0 = alloca float		; <float*> [#uses=2]
> +	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
> +	store float %x, float* %x_addr
> +	%1 = load float* %x_addr, align 4		; <float> [#uses=1]
> +	%2 = call float @llvm.exp.f32(float %1)		; <float> [#uses=1]
> +	store float %2, float* %0, align 4
> +	%3 = load float* %0, align 4		; <float> [#uses=1]
> +	store float %3, float* %retval, align 4
> +	br label %return
> +
> +return:		; preds = %entry
> +	%retval1 = load float* %retval		; <float> [#uses=1]
> +	ret float %retval1
> +}
> +
> +declare float @llvm.exp.f32(float) nounwind readonly
> +
> +define float @f2(float %x) nounwind noinline {
> +entry:
> +	%x_addr = alloca float		; <float*> [#uses=2]
> +	%retval = alloca float		; <float*> [#uses=2]
> +	%0 = alloca float		; <float*> [#uses=2]
> +	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
> +	store float %x, float* %x_addr
> +	%1 = load float* %x_addr, align 4		; <float> [#uses=1]
> +	%2 = call float @llvm.exp2.f32(float %1)		; <float> [#uses=1]
> +	store float %2, float* %0, align 4
> +	%3 = load float* %0, align 4		; <float> [#uses=1]
> +	store float %3, float* %retval, align 4
> +	br label %return
> +
> +return:		; preds = %entry
> +	%retval1 = load float* %retval		; <float> [#uses=1]
> +	ret float %retval1
> +}
> +
> +declare float @llvm.exp2.f32(float) nounwind readonly
> +
> +define float @f3(float %x) nounwind noinline {
> +entry:
> +	%x_addr = alloca float		; <float*> [#uses=2]
> +	%retval = alloca float		; <float*> [#uses=2]
> +	%0 = alloca float		; <float*> [#uses=2]
> +	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
> +	store float %x, float* %x_addr
> +	%1 = load float* %x_addr, align 4		; <float> [#uses=1]
> +	%2 = call float @llvm.pow.f32(float 1.000000e+01, float %1)		;  
> <float> [#uses=1]
> +	store float %2, float* %0, align 4
> +	%3 = load float* %0, align 4		; <float> [#uses=1]
> +	store float %3, float* %retval, align 4
> +	br label %return
> +
> +return:		; preds = %entry
> +	%retval1 = load float* %retval		; <float> [#uses=1]
> +	ret float %retval1
> +}
> +
> +declare float @llvm.pow.f32(float, float) nounwind readonly
> +
> +define float @f4(float %x) nounwind noinline {
> +entry:
> +	%x_addr = alloca float		; <float*> [#uses=2]
> +	%retval = alloca float		; <float*> [#uses=2]
> +	%0 = alloca float		; <float*> [#uses=2]
> +	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
> +	store float %x, float* %x_addr
> +	%1 = load float* %x_addr, align 4		; <float> [#uses=1]
> +	%2 = call float @llvm.log.f32(float %1)		; <float> [#uses=1]
> +	store float %2, float* %0, align 4
> +	%3 = load float* %0, align 4		; <float> [#uses=1]
> +	store float %3, float* %retval, align 4
> +	br label %return
> +
> +return:		; preds = %entry
> +	%retval1 = load float* %retval		; <float> [#uses=1]
> +	ret float %retval1
> +}
> +
> +declare float @llvm.log.f32(float) nounwind readonly
> +
> +define float @f5(float %x) nounwind noinline {
> +entry:
> +	%x_addr = alloca float		; <float*> [#uses=2]
> +	%retval = alloca float		; <float*> [#uses=2]
> +	%0 = alloca float		; <float*> [#uses=2]
> +	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
> +	store float %x, float* %x_addr
> +	%1 = load float* %x_addr, align 4		; <float> [#uses=1]
> +	%2 = call float @llvm.log2.f32(float %1)		; <float> [#uses=1]
> +	store float %2, float* %0, align 4
> +	%3 = load float* %0, align 4		; <float> [#uses=1]
> +	store float %3, float* %retval, align 4
> +	br label %return
> +
> +return:		; preds = %entry
> +	%retval1 = load float* %retval		; <float> [#uses=1]
> +	ret float %retval1
> +}
> +
> +declare float @llvm.log2.f32(float) nounwind readonly
> +
> +define float @f6(float %x) nounwind noinline {
> +entry:
> +	%x_addr = alloca float		; <float*> [#uses=2]
> +	%retval = alloca float		; <float*> [#uses=2]
> +	%0 = alloca float		; <float*> [#uses=2]
> +	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
> +	store float %x, float* %x_addr
> +	%1 = load float* %x_addr, align 4		; <float> [#uses=1]
> +	%2 = call float @llvm.log10.f32(float %1)		; <float> [#uses=1]
> +	store float %2, float* %0, align 4
> +	%3 = load float* %0, align 4		; <float> [#uses=1]
> +	store float %3, float* %retval, align 4
> +	br label %return
> +
> +return:		; preds = %entry
> +	%retval1 = load float* %retval		; <float> [#uses=1]
> +	ret float %retval1
> +}
> +
> +declare float @llvm.log10.f32(float) nounwind readonly
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list