[InstCombine] Add new rule for MIN(MAX(~A, ~B), ~C) et. al.
[oota-llvm.git] / test / Transforms / InstCombine / 2009-01-19-fmod-constant-float.ll
index 7c63ff69246125bb10088e1cc3914884147df128..5adcb6bfa07100709e63d6607bdfeb0522da36ff 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0x3FB99999A0000000 | count 2
-; RUN: llvm-as < %s | opt -simplifycfg -instcombine | llvm-dis | grep 0xBFB99999A0000000 | count 2
+; RUN: opt < %s -simplifycfg -instcombine -S | grep 0x3FB99999A0000000 | count 2
+; RUN: opt < %s -simplifycfg -instcombine -S | grep 0xBFB99999A0000000 | count 2
 ; check constant folding for 'frem'.  PR 3316.
 
 ; ModuleID = 'tt.c'
@@ -11,34 +11,32 @@ entry:
        %retval = alloca float          ; <float*> [#uses=2]
        %0 = alloca float               ; <float*> [#uses=2]
        %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
-       %1 = call double @fmod(double 1.000000e-01, double 1.000000e+00) nounwind readonly              ; <double> [#uses=1]
+       %1 = frem double 1.000000e-01, 1.000000e+00     ; <double> [#uses=1]
        %2 = fptrunc double %1 to float         ; <float> [#uses=1]
        store float %2, float* %0, align 4
-       %3 = load float* %0, align 4            ; <float> [#uses=1]
+       %3 = load float, 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]
+       %retval1 = load float, float* %retval           ; <float> [#uses=1]
        ret float %retval1
 }
 
-declare double @fmod(double, double) nounwind readonly
-
 define float @test2() nounwind {
 entry:
        %retval = alloca float          ; <float*> [#uses=2]
        %0 = alloca float               ; <float*> [#uses=2]
        %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
-       %1 = call double @fmod(double -1.000000e-01, double 1.000000e+00) nounwind readonly             ; <double> [#uses=1]
+       %1 = frem double -1.000000e-01, 1.000000e+00    ; <double> [#uses=1]
        %2 = fptrunc double %1 to float         ; <float> [#uses=1]
        store float %2, float* %0, align 4
-       %3 = load float* %0, align 4            ; <float> [#uses=1]
+       %3 = load float, 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]
+       %retval1 = load float, float* %retval           ; <float> [#uses=1]
        ret float %retval1
 }
 
@@ -47,15 +45,15 @@ entry:
        %retval = alloca float          ; <float*> [#uses=2]
        %0 = alloca float               ; <float*> [#uses=2]
        %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
-       %1 = call double @fmod(double 1.000000e-01, double -1.000000e+00) nounwind readonly             ; <double> [#uses=1]
+       %1 = frem double 1.000000e-01, -1.000000e+00    ; <double> [#uses=1]
        %2 = fptrunc double %1 to float         ; <float> [#uses=1]
        store float %2, float* %0, align 4
-       %3 = load float* %0, align 4            ; <float> [#uses=1]
+       %3 = load float, 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]
+       %retval1 = load float, float* %retval           ; <float> [#uses=1]
        ret float %retval1
 }
 
@@ -64,14 +62,14 @@ entry:
        %retval = alloca float          ; <float*> [#uses=2]
        %0 = alloca float               ; <float*> [#uses=2]
        %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
-       %1 = call double @fmod(double -1.000000e-01, double -1.000000e+00) nounwind readonly            ; <double> [#uses=1]
+       %1 = frem double -1.000000e-01, -1.000000e+00   ; <double> [#uses=1]
        %2 = fptrunc double %1 to float         ; <float> [#uses=1]
        store float %2, float* %0, align 4
-       %3 = load float* %0, align 4            ; <float> [#uses=1]
+       %3 = load float, 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]
+       %retval1 = load float, float* %retval           ; <float> [#uses=1]
        ret float %retval1
 }