llvm-6502/test/CodeGen/ARM/2009-02-27-SpillerBug.ll
2009-02-28 06:02:14 +00:00

230 lines
12 KiB
LLVM

; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2
target triple = "arm-apple-darwin9"
@a = external global double ; <double*> [#uses=1]
@N = external global double ; <double*> [#uses=1]
declare double @llvm.exp.f64(double) nounwind readonly
define fastcc void @findratio(double* nocapture %res1, double* nocapture %res2) nounwind {
bb.thread:
br label %bb52
bb32: ; preds = %bb52
%0 = add double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%1 = add i32 %j.1, 1 ; <i32> [#uses=1]
br label %bb52
bb52: ; preds = %bb53, %bb32, %bb.thread
%i.3494 = phi i32 [ 0, %bb.thread ], [ %3, %bb53 ], [ %i.3494, %bb32 ] ; <i32> [#uses=2]
%k.4 = phi double [ %0, %bb32 ], [ 0.000000e+00, %bb53 ], [ 0.000000e+00, %bb.thread ] ; <double> [#uses=2]
%j.1 = phi i32 [ %1, %bb32 ], [ 0, %bb53 ], [ 0, %bb.thread ] ; <i32> [#uses=2]
%2 = icmp sgt i32 %j.1, 99 ; <i1> [#uses=1]
br i1 %2, label %bb53, label %bb32
bb53: ; preds = %bb52
%3 = add i32 %i.3494, 1 ; <i32> [#uses=2]
%phitmp = icmp sgt i32 %3, 999999 ; <i1> [#uses=1]
br i1 %phitmp, label %bb55, label %bb52
bb55: ; preds = %bb53
%4 = load double* @a, align 4 ; <double> [#uses=10]
%5 = add double %4, 0.000000e+00 ; <double> [#uses=16]
%6 = fcmp ogt double %k.4, 0.000000e+00 ; <i1> [#uses=1]
%.pn404 = mul double %4, %4 ; <double> [#uses=4]
%.pn402 = mul double %5, %5 ; <double> [#uses=5]
%.pn165.in = load double* @N ; <double> [#uses=5]
%.pn198 = mul double 0.000000e+00, %5 ; <double> [#uses=1]
%.pn185 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn147 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn141 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1]
%.pn142 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1]
%.pn136 = fdiv double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn132 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1]
%.pn123 = fdiv double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn124 = fdiv double 0.000000e+00, %.pn198 ; <double> [#uses=1]
%.pn120 = fdiv double 0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%.pn117 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1]
%.pn118 = fdiv double %.pn185, %5 ; <double> [#uses=1]
%.pn88 = fdiv double %.pn147, %5 ; <double> [#uses=1]
%.pn81 = sub double %.pn141, %.pn142 ; <double> [#uses=1]
%.pn77 = sub double 0.000000e+00, %.pn136 ; <double> [#uses=1]
%.pn75 = sub double 0.000000e+00, %.pn132 ; <double> [#uses=1]
%.pn69 = sub double %.pn123, %.pn124 ; <double> [#uses=1]
%.pn67 = sub double 0.000000e+00, %.pn120 ; <double> [#uses=1]
%.pn56 = sub double %.pn117, %.pn118 ; <double> [#uses=1]
%.pn42 = sub double 0.000000e+00, %.pn88 ; <double> [#uses=1]
%.pn60 = mul double %.pn81, 0.000000e+00 ; <double> [#uses=1]
%.pn57 = add double %.pn77, 0.000000e+00 ; <double> [#uses=1]
%.pn58 = mul double %.pn75, %.pn165.in ; <double> [#uses=1]
%.pn32 = add double %.pn69, 0.000000e+00 ; <double> [#uses=1]
%.pn33 = mul double %.pn67, %.pn165.in ; <double> [#uses=1]
%.pn17 = sub double 0.000000e+00, %.pn60 ; <double> [#uses=1]
%.pn9 = add double %.pn57, %.pn58 ; <double> [#uses=1]
%.pn30 = mul double 0.000000e+00, %.pn56 ; <double> [#uses=1]
%.pn24 = mul double 0.000000e+00, %.pn42 ; <double> [#uses=1]
%.pn1 = add double %.pn32, %.pn33 ; <double> [#uses=1]
%.pn28 = sub double %.pn30, 0.000000e+00 ; <double> [#uses=1]
%.pn26 = add double %.pn28, 0.000000e+00 ; <double> [#uses=1]
%.pn22 = sub double %.pn26, 0.000000e+00 ; <double> [#uses=1]
%.pn20 = sub double %.pn24, 0.000000e+00 ; <double> [#uses=1]
%.pn18 = add double %.pn22, 0.000000e+00 ; <double> [#uses=1]
%.pn16 = add double %.pn20, 0.000000e+00 ; <double> [#uses=1]
%.pn14 = sub double %.pn18, 0.000000e+00 ; <double> [#uses=1]
%.pn12 = sub double %.pn16, %.pn17 ; <double> [#uses=1]
%.pn10 = add double %.pn14, 0.000000e+00 ; <double> [#uses=1]
%.pn8 = add double %.pn12, 0.000000e+00 ; <double> [#uses=1]
%.pn6 = sub double %.pn10, 0.000000e+00 ; <double> [#uses=1]
%.pn4 = sub double %.pn8, %.pn9 ; <double> [#uses=1]
%.pn2 = add double %.pn6, 0.000000e+00 ; <double> [#uses=1]
%.pn = add double %.pn4, 0.000000e+00 ; <double> [#uses=1]
%N1.0 = sub double %.pn2, 0.000000e+00 ; <double> [#uses=2]
%D1.0 = sub double %.pn, %.pn1 ; <double> [#uses=2]
br i1 %6, label %bb62, label %bb64
bb62: ; preds = %bb55
%7 = mul double 0.000000e+00, %4 ; <double> [#uses=1]
%8 = sub double -0.000000e+00, %7 ; <double> [#uses=3]
%9 = mul double 0.000000e+00, %5 ; <double> [#uses=1]
%10 = sub double -0.000000e+00, %9 ; <double> [#uses=3]
%11 = mul double %.pn404, %4 ; <double> [#uses=5]
%12 = mul double %.pn402, %5 ; <double> [#uses=5]
%13 = mul double 0.000000e+00, -2.000000e+00 ; <double> [#uses=1]
%14 = fdiv double 0.000000e+00, %.pn402 ; <double> [#uses=1]
%15 = sub double 0.000000e+00, %14 ; <double> [#uses=1]
%16 = mul double 0.000000e+00, %15 ; <double> [#uses=1]
%17 = add double %13, %16 ; <double> [#uses=1]
%18 = mul double %.pn165.in, -2.000000e+00 ; <double> [#uses=5]
%19 = mul double %18, 0.000000e+00 ; <double> [#uses=1]
%20 = add double %17, %19 ; <double> [#uses=1]
%21 = mul double 0.000000e+00, %20 ; <double> [#uses=1]
%22 = add double 0.000000e+00, %21 ; <double> [#uses=1]
%23 = fdiv double 0.000000e+00, %12 ; <double> [#uses=1]
%24 = sub double 0.000000e+00, %23 ; <double> [#uses=0]
%25 = mul double %18, 0.000000e+00 ; <double> [#uses=1]
%26 = add double 0.000000e+00, %25 ; <double> [#uses=1]
%27 = mul double 0.000000e+00, %26 ; <double> [#uses=1]
%28 = sub double %22, %27 ; <double> [#uses=1]
%29 = mul double %11, %4 ; <double> [#uses=1]
%30 = mul double %12, %5 ; <double> [#uses=3]
%31 = mul double %.pn165.in, -4.000000e+00 ; <double> [#uses=1]
%32 = mul double %.pn165.in, 0x3FF5555555555555 ; <double> [#uses=1]
%33 = mul double %32, 0.000000e+00 ; <double> [#uses=2]
%34 = add double %28, 0.000000e+00 ; <double> [#uses=1]
%35 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=1]
%36 = fdiv double %35, %11 ; <double> [#uses=1]
%37 = fdiv double 0.000000e+00, %12 ; <double> [#uses=1]
%38 = sub double %36, %37 ; <double> [#uses=1]
%39 = mul double 0.000000e+00, %38 ; <double> [#uses=1]
%40 = add double 0.000000e+00, %39 ; <double> [#uses=1]
%41 = add double %40, 0.000000e+00 ; <double> [#uses=1]
%42 = add double %41, 0.000000e+00 ; <double> [#uses=1]
%43 = mul double %42, 0.000000e+00 ; <double> [#uses=1]
%44 = sub double %34, %43 ; <double> [#uses=1]
%45 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1]
%46 = sub double -0.000000e+00, %45 ; <double> [#uses=2]
%47 = fdiv double %46, 0.000000e+00 ; <double> [#uses=1]
%48 = mul double %30, %5 ; <double> [#uses=1]
%49 = fdiv double 0.000000e+00, %48 ; <double> [#uses=1]
%50 = sub double %47, %49 ; <double> [#uses=1]
%51 = mul double %50, -4.000000e+00 ; <double> [#uses=1]
%52 = add double %51, 0.000000e+00 ; <double> [#uses=1]
%53 = fdiv double %46, %11 ; <double> [#uses=1]
%54 = sub double %53, 0.000000e+00 ; <double> [#uses=1]
%55 = mul double %31, %54 ; <double> [#uses=1]
%56 = add double %52, %55 ; <double> [#uses=1]
%57 = add double %56, 0.000000e+00 ; <double> [#uses=1]
%58 = add double %44, %57 ; <double> [#uses=1]
%59 = sub double %58, 0.000000e+00 ; <double> [#uses=1]
%60 = tail call double @llvm.exp.f64(double 0.000000e+00) nounwind ; <double> [#uses=1]
%61 = sub double -0.000000e+00, %60 ; <double> [#uses=1]
%62 = fdiv double 0.000000e+00, -6.000000e+00 ; <double> [#uses=1]
%63 = fdiv double %61, %5 ; <double> [#uses=1]
%64 = sub double 0.000000e+00, %63 ; <double> [#uses=1]
%65 = mul double %62, %64 ; <double> [#uses=1]
%66 = sub double 0.000000e+00, %65 ; <double> [#uses=1]
%67 = sub double -0.000000e+00, 0.000000e+00 ; <double> [#uses=2]
%68 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1]
%69 = sub double -0.000000e+00, %68 ; <double> [#uses=2]
%70 = fdiv double %67, %.pn404 ; <double> [#uses=1]
%71 = fdiv double %69, %.pn402 ; <double> [#uses=1]
%72 = sub double %70, %71 ; <double> [#uses=1]
%73 = mul double %72, -5.000000e-01 ; <double> [#uses=1]
%74 = fdiv double %67, %4 ; <double> [#uses=1]
%75 = fdiv double %69, %5 ; <double> [#uses=1]
%76 = sub double %74, %75 ; <double> [#uses=1]
%77 = mul double %76, 0.000000e+00 ; <double> [#uses=1]
%78 = add double %73, %77 ; <double> [#uses=1]
%79 = mul double 0.000000e+00, %78 ; <double> [#uses=1]
%80 = add double %66, %79 ; <double> [#uses=1]
%81 = fdiv double 0.000000e+00, %.pn404 ; <double> [#uses=1]
%82 = fdiv double 0.000000e+00, %.pn402 ; <double> [#uses=1]
%83 = sub double %81, %82 ; <double> [#uses=1]
%84 = mul double %83, -5.000000e-01 ; <double> [#uses=1]
%85 = fdiv double 0.000000e+00, %4 ; <double> [#uses=1]
%86 = fdiv double 0.000000e+00, %5 ; <double> [#uses=1]
%87 = sub double %85, %86 ; <double> [#uses=1]
%88 = mul double %87, 0.000000e+00 ; <double> [#uses=1]
%89 = add double %84, %88 ; <double> [#uses=1]
%90 = mul double 0.000000e+00, %89 ; <double> [#uses=1]
%91 = sub double %80, %90 ; <double> [#uses=1]
%92 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1]
%93 = sub double -0.000000e+00, %92 ; <double> [#uses=1]
%94 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1]
%95 = sub double -0.000000e+00, %94 ; <double> [#uses=3]
%96 = fdiv double %95, %.pn402 ; <double> [#uses=1]
%97 = sub double 0.000000e+00, %96 ; <double> [#uses=1]
%98 = mul double 0.000000e+00, %97 ; <double> [#uses=1]
%99 = fdiv double %93, %11 ; <double> [#uses=1]
%100 = fdiv double %95, %12 ; <double> [#uses=1]
%101 = sub double %99, %100 ; <double> [#uses=1]
%102 = sub double %98, %101 ; <double> [#uses=1]
%103 = fdiv double %95, %5 ; <double> [#uses=1]
%104 = sub double 0.000000e+00, %103 ; <double> [#uses=1]
%105 = mul double %18, %104 ; <double> [#uses=1]
%106 = add double %102, %105 ; <double> [#uses=1]
%107 = mul double %106, %k.4 ; <double> [#uses=1]
%108 = add double %91, %107 ; <double> [#uses=1]
%109 = sub double %108, 0.000000e+00 ; <double> [#uses=1]
%110 = tail call double @llvm.exp.f64(double %8) nounwind ; <double> [#uses=1]
%111 = sub double -0.000000e+00, %110 ; <double> [#uses=2]
%112 = tail call double @llvm.exp.f64(double %10) nounwind ; <double> [#uses=1]
%113 = sub double -0.000000e+00, %112 ; <double> [#uses=2]
%114 = fdiv double %111, %11 ; <double> [#uses=1]
%115 = fdiv double %113, %12 ; <double> [#uses=1]
%116 = sub double %114, %115 ; <double> [#uses=1]
%117 = mul double 0.000000e+00, %116 ; <double> [#uses=1]
%118 = fdiv double %111, %29 ; <double> [#uses=1]
%119 = fdiv double %113, %30 ; <double> [#uses=1]
%120 = sub double %118, %119 ; <double> [#uses=1]
%121 = sub double %117, %120 ; <double> [#uses=1]
%122 = mul double %18, 0.000000e+00 ; <double> [#uses=1]
%123 = add double %121, %122 ; <double> [#uses=1]
%124 = mul double %33, 0.000000e+00 ; <double> [#uses=1]
%125 = add double %123, %124 ; <double> [#uses=1]
%126 = add double %109, %125 ; <double> [#uses=1]
%127 = tail call double @llvm.exp.f64(double 0.000000e+00) nounwind ; <double> [#uses=1]
%128 = sub double -0.000000e+00, %127 ; <double> [#uses=2]
%129 = fdiv double %128, %30 ; <double> [#uses=1]
%130 = sub double 0.000000e+00, %129 ; <double> [#uses=1]
%131 = sub double 0.000000e+00, %130 ; <double> [#uses=1]
%132 = fdiv double 0.000000e+00, %.pn404 ; <double> [#uses=1]
%133 = sub double %132, 0.000000e+00 ; <double> [#uses=1]
%134 = mul double %18, %133 ; <double> [#uses=1]
%135 = add double %131, %134 ; <double> [#uses=1]
%136 = fdiv double %128, %5 ; <double> [#uses=1]
%137 = sub double 0.000000e+00, %136 ; <double> [#uses=1]
%138 = mul double %33, %137 ; <double> [#uses=1]
%139 = add double %135, %138 ; <double> [#uses=1]
%140 = sub double %126, %139 ; <double> [#uses=1]
%141 = add double %N1.0, %59 ; <double> [#uses=1]
%142 = add double %D1.0, %140 ; <double> [#uses=1]
br label %bb64
bb64: ; preds = %bb62, %bb55
%N1.0.pn = phi double [ %141, %bb62 ], [ %N1.0, %bb55 ] ; <double> [#uses=1]
%D1.0.pn = phi double [ %142, %bb62 ], [ %D1.0, %bb55 ] ; <double> [#uses=1]
%x.1 = fdiv double %N1.0.pn, %D1.0.pn ; <double> [#uses=0]
ret void
}