diff options
Diffstat (limited to 'test/Transforms')
31 files changed, 816 insertions, 1211 deletions
diff --git a/test/Transforms/CodeGenPrepare/basic.ll b/test/Transforms/CodeGenPrepare/basic.ll index ebf10f0..c68e77e 100644 --- a/test/Transforms/CodeGenPrepare/basic.ll +++ b/test/Transforms/CodeGenPrepare/basic.ll @@ -5,7 +5,7 @@ target triple = "x86_64-apple-darwin10.0.0" ; CHECK: @test1 ; objectsize should fold to a constant, which causes the branch to fold to an -; uncond branch. +; uncond branch. Next, we fold the control flow alltogether. ; rdar://8785296 define i32 @test1(i8* %ptr) nounwind ssp noredzone align 2 { entry: @@ -13,8 +13,8 @@ entry: %1 = icmp ugt i64 %0, 3 br i1 %1, label %T, label %trap -; CHECK: entry: -; CHECK-NEXT: br label %T +; CHECK: T: +; CHECK-NOT: br label % trap: ; preds = %0, %entry tail call void @llvm.trap() noreturn nounwind diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll index a386206..7a8cdd5 100644 --- a/test/Transforms/DeadStoreElimination/simple.ll +++ b/test/Transforms/DeadStoreElimination/simple.ll @@ -276,3 +276,37 @@ define void @test22(i1 %i, i32 %k, i32 %m) nounwind { ; CHECK-NEXT: ret void ret void } + +; PR13547 +; CHECK: @test23 +; CHECK: store i8 97 +; CHECK: store i8 0 +declare noalias i8* @strdup(i8* nocapture) nounwind +define noalias i8* @test23() nounwind uwtable ssp { + %x = alloca [2 x i8], align 1 + %arrayidx = getelementptr inbounds [2 x i8]* %x, i64 0, i64 0 + store i8 97, i8* %arrayidx, align 1 + %arrayidx1 = getelementptr inbounds [2 x i8]* %x, i64 0, i64 1 + store i8 0, i8* %arrayidx1, align 1 + %call = call i8* @strdup(i8* %arrayidx) nounwind + ret i8* %call +} + +; Make sure same sized store to later element is deleted +; CHECK: @test24 +; CHECK-NOT: store i32 0 +; CHECK-NOT: store i32 0 +; CHECK: store i32 %b +; CHECK: store i32 %c +; CHECK: ret void +define void @test24([2 x i32]* %a, i32 %b, i32 %c) nounwind { + %1 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + store i32 0, i32* %1, align 4 + %2 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + store i32 0, i32* %2, align 4 + %3 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 0 + store i32 %b, i32* %3, align 4 + %4 = getelementptr inbounds [2 x i32]* %a, i64 0, i64 1 + store i32 %c, i32* %4, align 4 + ret void +} diff --git a/test/Transforms/GVN/edge.ll b/test/Transforms/GVN/edge.ll new file mode 100644 index 0000000..32392f3 --- /dev/null +++ b/test/Transforms/GVN/edge.ll @@ -0,0 +1,60 @@ +; RUN: opt %s -gvn -S -o - | FileCheck %s + +define i32 @f1(i32 %x) { + ; CHECK: define i32 @f1( +bb0: + %cmp = icmp eq i32 %x, 0 + br i1 %cmp, label %bb2, label %bb1 +bb1: + br label %bb2 +bb2: + %cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ] + %foo = add i32 %cond, %x + ret i32 %foo + ; CHECK: bb2: + ; CHECK: ret i32 %x +} + +define i32 @f2(i32 %x) { + ; CHECK: define i32 @f2( +bb0: + %cmp = icmp ne i32 %x, 0 + br i1 %cmp, label %bb1, label %bb2 +bb1: + br label %bb2 +bb2: + %cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ] + %foo = add i32 %cond, %x + ret i32 %foo + ; CHECK: bb2: + ; CHECK: ret i32 %x +} + +define i32 @f3(i32 %x) { + ; CHECK: define i32 @f3( +bb0: + switch i32 %x, label %bb1 [ i32 0, label %bb2] +bb1: + br label %bb2 +bb2: + %cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ] + %foo = add i32 %cond, %x + ret i32 %foo + ; CHECK: bb2: + ; CHECK: ret i32 %x +} + +declare void @g(i1) +define void @f4(i8 * %x) { +; CHECK: define void @f4( +bb0: + %y = icmp eq i8* null, %x + br i1 %y, label %bb2, label %bb1 +bb1: + br label %bb2 +bb2: + %zed = icmp eq i8* null, %x + call void @g(i1 %zed) +; CHECK: call void @g(i1 %y) + ret void +} diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index 9e08004..e764169 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -620,7 +620,7 @@ entry: ; CHECK-NOT: load ; CHECK: load i16* ; CHECK-NOT: load -; CHECK-ret i32 +; CHECK: ret i32 } define i32 @test_widening2() nounwind ssp noredzone { @@ -644,7 +644,7 @@ entry: ; CHECK-NOT: load ; CHECK: load i32* ; CHECK-NOT: load -; CHECK-ret i32 +; CHECK: ret i32 } declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind diff --git a/test/Transforms/GlobalOpt/cleanup-pointer-root-users.ll b/test/Transforms/GlobalOpt/cleanup-pointer-root-users.ll index f426120..a472f10 100644 --- a/test/Transforms/GlobalOpt/cleanup-pointer-root-users.ll +++ b/test/Transforms/GlobalOpt/cleanup-pointer-root-users.ll @@ -1,12 +1,12 @@ ; RUN: opt -globalopt -S -o - < %s | FileCheck %s -@test1 = internal global i8* null +@glbl = internal global i8* null define void @test1a() { ; CHECK: @test1a ; CHECK-NOT: store ; CHECK-NEXT: ret void - store i8* null, i8** @test1 + store i8* null, i8** @glbl ret void } @@ -14,6 +14,36 @@ define void @test1b(i8* %p) { ; CHECK: @test1b ; CHECK-NEXT: store ; CHECK-NEXT: ret void - store i8* %p, i8** @test1 + store i8* %p, i8** @glbl ret void } + +define void @test2() { +; CHECK: @test2 +; CHECK: alloca i8 + %txt = alloca i8 + call void @foo2(i8* %txt) + %call2 = call i8* @strdup(i8* %txt) + store i8* %call2, i8** @glbl + ret void +} +declare i8* @strdup(i8*) +declare void @foo2(i8*) + +define void @test3() uwtable { +; CHECK: @test3 +; CHECK-NOT: bb1: +; CHECK-NOT: bb2: +; CHECK: invoke + %ptr = invoke i8* @_Znwm(i64 1) + to label %bb1 unwind label %bb2 +bb1: + store i8* %ptr, i8** @glbl + unreachable +bb2: + %tmp1 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0 + cleanup + resume { i8*, i32 } %tmp1 +} +declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*) +declare i8* @_Znwm(i64) diff --git a/test/Transforms/Inline/always-inline.ll b/test/Transforms/Inline/always-inline.ll index e0be41f..c918bc9 100644 --- a/test/Transforms/Inline/always-inline.ll +++ b/test/Transforms/Inline/always-inline.ll @@ -33,7 +33,6 @@ define void @outer2(i32 %N) { ; ; CHECK: @outer2 ; CHECK-NOT: call void @inner2 -; CHECK alloca i32, i32 %N ; CHECK-NOT: call void @inner2 ; CHECK: ret void diff --git a/test/Transforms/Inline/inline-byval-bonus.ll b/test/Transforms/Inline/inline-byval-bonus.ll new file mode 100644 index 0000000..f3ed819 --- /dev/null +++ b/test/Transforms/Inline/inline-byval-bonus.ll @@ -0,0 +1,193 @@ +; RUN: opt -S -inline -inline-threshold=275 < %s | FileCheck %s +; PR13095 + +; The performance of the c-ray benchmark largely depends on the inlining of a +; specific call to @ray_sphere. This test case is designed to verify that it's +; inlined at -O3. + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.8.0" + +%struct.sphere = type { %struct.vec3, double, %struct.material, %struct.sphere* } +%struct.vec3 = type { double, double, double } +%struct.material = type { %struct.vec3, double, double } +%struct.ray = type { %struct.vec3, %struct.vec3 } +%struct.spoint = type { %struct.vec3, %struct.vec3, %struct.vec3, double } + +define i32 @caller(%struct.sphere* %i) { + %shadow_ray = alloca %struct.ray, align 8 + call void @fix(%struct.ray* %shadow_ray) + + %call = call i32 @ray_sphere(%struct.sphere* %i, %struct.ray* byval align 8 %shadow_ray, %struct.spoint* null) + ret i32 %call + +; CHECK: @caller +; CHECK-NOT: call i32 @ray_sphere +; CHECK: ret i32 +} + +declare void @fix(%struct.ray*) + +define i32 @ray_sphere(%struct.sphere* nocapture %sph, %struct.ray* nocapture byval align 8 %ray, %struct.spoint* %sp) nounwind uwtable ssp { + %1 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 0 + %2 = load double* %1, align 8 + %3 = fmul double %2, %2 + %4 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 1 + %5 = load double* %4, align 8 + %6 = fmul double %5, %5 + %7 = fadd double %3, %6 + %8 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 1, i32 2 + %9 = load double* %8, align 8 + %10 = fmul double %9, %9 + %11 = fadd double %7, %10 + %12 = fmul double %2, 2.000000e+00 + %13 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 0 + %14 = load double* %13, align 8 + %15 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 0 + %16 = load double* %15, align 8 + %17 = fsub double %14, %16 + %18 = fmul double %12, %17 + %19 = fmul double %5, 2.000000e+00 + %20 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 1 + %21 = load double* %20, align 8 + %22 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 1 + %23 = load double* %22, align 8 + %24 = fsub double %21, %23 + %25 = fmul double %19, %24 + %26 = fadd double %18, %25 + %27 = fmul double %9, 2.000000e+00 + %28 = getelementptr inbounds %struct.ray* %ray, i64 0, i32 0, i32 2 + %29 = load double* %28, align 8 + %30 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 0, i32 2 + %31 = load double* %30, align 8 + %32 = fsub double %29, %31 + %33 = fmul double %27, %32 + %34 = fadd double %26, %33 + %35 = fmul double %16, %16 + %36 = fmul double %23, %23 + %37 = fadd double %35, %36 + %38 = fmul double %31, %31 + %39 = fadd double %37, %38 + %40 = fmul double %14, %14 + %41 = fadd double %40, %39 + %42 = fmul double %21, %21 + %43 = fadd double %42, %41 + %44 = fmul double %29, %29 + %45 = fadd double %44, %43 + %46 = fsub double -0.000000e+00, %16 + %47 = fmul double %14, %46 + %48 = fmul double %21, %23 + %49 = fsub double %47, %48 + %50 = fmul double %29, %31 + %51 = fsub double %49, %50 + %52 = fmul double %51, 2.000000e+00 + %53 = fadd double %52, %45 + %54 = getelementptr inbounds %struct.sphere* %sph, i64 0, i32 1 + %55 = load double* %54, align 8 + %56 = fmul double %55, %55 + %57 = fsub double %53, %56 + %58 = fmul double %34, %34 + %59 = fmul double %11, 4.000000e+00 + %60 = fmul double %59, %57 + %61 = fsub double %58, %60 + %62 = fcmp olt double %61, 0.000000e+00 + br i1 %62, label %130, label %63 + +; <label>:63 ; preds = %0 + %64 = tail call double @sqrt(double %61) nounwind readnone + %65 = fsub double -0.000000e+00, %34 + %66 = fsub double %64, %34 + %67 = fmul double %11, 2.000000e+00 + %68 = fdiv double %66, %67 + %69 = fsub double %65, %64 + %70 = fdiv double %69, %67 + %71 = fcmp olt double %68, 1.000000e-06 + %72 = fcmp olt double %70, 1.000000e-06 + %or.cond = and i1 %71, %72 + br i1 %or.cond, label %130, label %73 + +; <label>:73 ; preds = %63 + %74 = fcmp ogt double %68, 1.000000e+00 + %75 = fcmp ogt double %70, 1.000000e+00 + %or.cond1 = and i1 %74, %75 + br i1 %or.cond1, label %130, label %76 + +; <label>:76 ; preds = %73 + %77 = icmp eq %struct.spoint* %sp, null + br i1 %77, label %130, label %78 + +; <label>:78 ; preds = %76 + %t1.0 = select i1 %71, double %70, double %68 + %t2.0 = select i1 %72, double %t1.0, double %70 + %79 = fcmp olt double %t1.0, %t2.0 + %80 = select i1 %79, double %t1.0, double %t2.0 + %81 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 3 + store double %80, double* %81, align 8 + %82 = fmul double %80, %2 + %83 = fadd double %14, %82 + %84 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 0 + store double %83, double* %84, align 8 + %85 = fmul double %5, %80 + %86 = fadd double %21, %85 + %87 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 1 + store double %86, double* %87, align 8 + %88 = fmul double %9, %80 + %89 = fadd double %29, %88 + %90 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 0, i32 2 + store double %89, double* %90, align 8 + %91 = load double* %15, align 8 + %92 = fsub double %83, %91 + %93 = load double* %54, align 8 + %94 = fdiv double %92, %93 + %95 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 0 + store double %94, double* %95, align 8 + %96 = load double* %22, align 8 + %97 = fsub double %86, %96 + %98 = load double* %54, align 8 + %99 = fdiv double %97, %98 + %100 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 1 + store double %99, double* %100, align 8 + %101 = load double* %30, align 8 + %102 = fsub double %89, %101 + %103 = load double* %54, align 8 + %104 = fdiv double %102, %103 + %105 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 1, i32 2 + store double %104, double* %105, align 8 + %106 = fmul double %2, %94 + %107 = fmul double %5, %99 + %108 = fadd double %106, %107 + %109 = fmul double %9, %104 + %110 = fadd double %108, %109 + %111 = fmul double %110, 2.000000e+00 + %112 = fmul double %94, %111 + %113 = fsub double %112, %2 + %114 = fsub double -0.000000e+00, %113 + %115 = fmul double %99, %111 + %116 = fsub double %115, %5 + %117 = fsub double -0.000000e+00, %116 + %118 = fmul double %104, %111 + %119 = fsub double %118, %9 + %120 = fsub double -0.000000e+00, %119 + %.06 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 0 + %.18 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 1 + %.210 = getelementptr inbounds %struct.spoint* %sp, i64 0, i32 2, i32 2 + %121 = fmul double %113, %113 + %122 = fmul double %116, %116 + %123 = fadd double %121, %122 + %124 = fmul double %119, %119 + %125 = fadd double %123, %124 + %126 = tail call double @sqrt(double %125) nounwind readnone + %127 = fdiv double %114, %126 + store double %127, double* %.06, align 8 + %128 = fdiv double %117, %126 + store double %128, double* %.18, align 8 + %129 = fdiv double %120, %126 + store double %129, double* %.210, align 8 + br label %130 + +; <label>:130 ; preds = %78, %76, %73, %63, %0 + %.0 = phi i32 [ 0, %0 ], [ 0, %73 ], [ 0, %63 ], [ 1, %76 ], [ 1, %78 ] + ret i32 %.0 +} + +declare double @sqrt(double) nounwind readnone diff --git a/test/Transforms/Inline/inline_constprop.ll b/test/Transforms/Inline/inline_constprop.ll index dc35b60..0b48a72 100644 --- a/test/Transforms/Inline/inline_constprop.ll +++ b/test/Transforms/Inline/inline_constprop.ll @@ -110,3 +110,65 @@ bb.merge: bb.false: ret i32 %sub } + + +define i32 @PR13412.main() { +; This is a somewhat complicated three layer subprogram that was reported to +; compute the wrong value for a branch due to assuming that an argument +; mid-inline couldn't be equal to another pointer. +; +; After inlining, the branch should point directly to the exit block, not to +; the intermediate block. +; CHECK: @PR13412.main +; CHECK: br i1 true, label %[[TRUE_DEST:.*]], label %[[FALSE_DEST:.*]] +; CHECK: [[FALSE_DEST]]: +; CHECK-NEXT: call void @PR13412.fail() +; CHECK: [[TRUE_DEST]]: +; CHECK-NEXT: ret i32 0 + +entry: + %i1 = alloca i64 + store i64 0, i64* %i1 + %arraydecay = bitcast i64* %i1 to i32* + %call = call i1 @PR13412.first(i32* %arraydecay, i32* %arraydecay) + br i1 %call, label %cond.end, label %cond.false + +cond.false: + call void @PR13412.fail() + br label %cond.end + +cond.end: + ret i32 0 +} + +define internal i1 @PR13412.first(i32* %a, i32* %b) { +entry: + %call = call i32* @PR13412.second(i32* %a, i32* %b) + %cmp = icmp eq i32* %call, %b + ret i1 %cmp +} + +declare void @PR13412.fail() + +define internal i32* @PR13412.second(i32* %a, i32* %b) { +entry: + %sub.ptr.lhs.cast = ptrtoint i32* %b to i64 + %sub.ptr.rhs.cast = ptrtoint i32* %a to i64 + %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast + %sub.ptr.div = ashr exact i64 %sub.ptr.sub, 2 + %cmp = icmp ugt i64 %sub.ptr.div, 1 + br i1 %cmp, label %if.then, label %if.end3 + +if.then: + %0 = load i32* %a + %1 = load i32* %b + %cmp1 = icmp eq i32 %0, %1 + br i1 %cmp1, label %return, label %if.end3 + +if.end3: + br label %return + +return: + %retval.0 = phi i32* [ %b, %if.end3 ], [ %a, %if.then ] + ret i32* %retval.0 +} diff --git a/test/Transforms/InstCombine/2008-11-08-FCmp.ll b/test/Transforms/InstCombine/2008-11-08-FCmp.ll index c636288..f33a1f5 100644 --- a/test/Transforms/InstCombine/2008-11-08-FCmp.ll +++ b/test/Transforms/InstCombine/2008-11-08-FCmp.ll @@ -45,3 +45,12 @@ define i1 @test6(i32 %val) { ret i1 %2 ; CHECK: ret i1 false } + +; Check that optimizing unsigned >= comparisons correctly distinguishes +; positive and negative constants. <rdar://problem/12029145> +define i1 @test7(i32 %val) { + %1 = uitofp i32 %val to double + %2 = fcmp oge double %1, 3.200000e+00 + ret i1 %2 +; CHECK: icmp ugt i32 %val, 3 +} diff --git a/test/Transforms/InstCombine/2012-07-25-LoadPart.ll b/test/Transforms/InstCombine/2012-07-25-LoadPart.ll new file mode 100644 index 0000000..73e5a66 --- /dev/null +++ b/test/Transforms/InstCombine/2012-07-25-LoadPart.ll @@ -0,0 +1,12 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s +; PR13442 + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128" + +@test = constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] + +define i64 @foo() { + %ret = load i64* bitcast (i8* getelementptr (i8* bitcast ([4 x i32]* @test to i8*), i64 2) to i64*), align 1 + ret i64 %ret + ; CHECK: ret i64 844424930263040 +} diff --git a/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll b/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll new file mode 100644 index 0000000..6f3df5b --- /dev/null +++ b/test/Transforms/InstCombine/2012-07-30-addrsp-bitcast.ll @@ -0,0 +1,10 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s +; CHECK: bitcast + +@base = internal addrspace(3) unnamed_addr global [16 x i32] zeroinitializer, align 16 +declare void @foo(i32*) + +define void @test() nounwind { + call void @foo(i32* getelementptr (i32* bitcast ([16 x i32] addrspace(3)* @base to i32*), i64 2147483647)) nounwind + ret void +} diff --git a/test/Transforms/InstCombine/crash.ll b/test/Transforms/InstCombine/crash.ll index d5af532..2ef6ac6 100644 --- a/test/Transforms/InstCombine/crash.ll +++ b/test/Transforms/InstCombine/crash.ll @@ -132,12 +132,14 @@ define i32 @test5a() { } define void @test5() { - store i1 true, i1* undef - %1 = invoke i32 @test5a() to label %exit unwind label %exit + store i1 true, i1* undef + %r = invoke i32 @test5a() to label %exit unwind label %unwind +unwind: + %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 + cleanup + br label %exit exit: - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 - cleanup - ret void + ret void } diff --git a/test/Transforms/InstCombine/fcmp.ll b/test/Transforms/InstCombine/fcmp.ll index d08cbf5..fc1ced0 100644 --- a/test/Transforms/InstCombine/fcmp.ll +++ b/test/Transforms/InstCombine/fcmp.ll @@ -69,3 +69,93 @@ define float @test8(float %x) nounwind readnone optsize ssp { ; CHECK: @test8 ; CHECK-NEXT: fcmp olt float %x, 0.000000e+00 } + +declare double @fabs(double) nounwind readnone + +define i32 @test9(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp olt double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test9 +; CHECK-NOT: fabs +; CHECK: ret i32 0 +} + +define i32 @test10(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp ole double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test10 +; CHECK-NOT: fabs +; CHECK: fcmp oeq double %a, 0.000000e+00 +} + +define i32 @test11(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp ogt double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test11 +; CHECK-NOT: fabs +; CHECK: fcmp one double %a, 0.000000e+00 +} + +define i32 @test12(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp oge double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test12 +; CHECK-NOT: fabs +; CHECK: fcmp ord double %a, 0.000000e+00 +} + +define i32 @test13(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp une double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test13 +; CHECK-NOT: fabs +; CHECK: fcmp une double %a, 0.000000e+00 +} + +define i32 @test14(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp oeq double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test14 +; CHECK-NOT: fabs +; CHECK: fcmp oeq double %a, 0.000000e+00 +} + +define i32 @test15(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp one double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test15 +; CHECK-NOT: fabs +; CHECK: fcmp one double %a, 0.000000e+00 +} + +define i32 @test16(double %a) nounwind { + %call = tail call double @fabs(double %a) nounwind + %cmp = fcmp ueq double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +; CHECK: @test16 +; CHECK-NOT: fabs +; CHECK: fcmp ueq double %a, 0.000000e+00 +} + +; Don't crash. +define i32 @test17(double %a, double (double)* %p) nounwind { + %call = tail call double %p(double %a) nounwind + %cmp = fcmp ueq double %call, 0.000000e+00 + %conv = zext i1 %cmp to i32 + ret i32 %conv +} diff --git a/test/Transforms/ScalarRepl/memcpy-from-global.ll b/test/Transforms/InstCombine/memcpy-from-global.ll index 5557a8f..83c893e 100644 --- a/test/Transforms/ScalarRepl/memcpy-from-global.ll +++ b/test/Transforms/InstCombine/memcpy-from-global.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -scalarrepl -S | FileCheck %s +; RUN: opt < %s -instcombine -S | FileCheck %s target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" @C.0.1248 = internal constant [128 x float] [ float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float -1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float -1.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00 ], align 32 ; <[128 x float]*> [#uses=1] @@ -6,13 +6,11 @@ define float @test1(i32 %hash, float %x, float %y, float %z, float %w) { entry: %lookupTable = alloca [128 x float], align 16 ; <[128 x float]*> [#uses=5] %lookupTable1 = bitcast [128 x float]* %lookupTable to i8* ; <i8*> [#uses=1] - call void @llvm.memcpy.i32( i8* %lookupTable1, i8* bitcast ([128 x float]* @C.0.1248 to i8*), i32 512, i32 16 ) + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %lookupTable1, i8* bitcast ([128 x float]* @C.0.1248 to i8*), i64 512, i32 16, i1 false) ; CHECK: @test1 ; CHECK-NOT: alloca ; CHECK-NOT: call{{.*}}@llvm.memcpy -; CHECK: %lookupTable1 = bitcast [128 x float]* @C.0.1248 to i8* -; CHECK-NOT: call{{.*}}@llvm.memcpy %tmp3 = shl i32 %hash, 2 ; <i32> [#uses=1] %tmp5 = and i32 %tmp3, 124 ; <i32> [#uses=4] @@ -38,10 +36,6 @@ entry: ret float %tmp43 } -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - - - declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind %T = type { i8, [123 x i8] } @@ -59,10 +53,11 @@ define void @test2() { ; CHECK: @test2 ; %A alloca is deleted -; CHECK-NEXT: %B = alloca %T +; CHECK-NEXT: alloca [124 x i8] +; CHECK-NEXT: getelementptr inbounds [124 x i8]* ; use @G instead of %A -; CHECK-NEXT: %a = bitcast %T* @G to i8* +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* getelementptr inbounds (%T* @G, i64 0, i32 0) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false) call void @bar(i8* %b) @@ -79,8 +74,7 @@ define void @test3() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK: @test3 -; CHECK-NEXT: %a = bitcast %T* @G to i8* -; CHECK-NEXT: call void @bar(i8* %a) +; CHECK-NEXT: call void @bar(i8* getelementptr inbounds (%T* @G, i64 0, i32 0)) ret void } @@ -90,8 +84,7 @@ define void @test4() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @baz(i8* byval %a) ; CHECK: @test4 -; CHECK-NEXT: %a = bitcast %T* @G to i8* -; CHECK-NEXT: call void @baz(i8* byval %a) +; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T* @G, i64 0, i32 0)) ret void } @@ -103,8 +96,7 @@ define void @test5() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%T* @G to i8*), i64 124, i32 4, i1 false) call void @baz(i8* byval %a) ; CHECK: @test5 -; CHECK-NEXT: %a = bitcast %T* @G to i8* -; CHECK-NEXT: call void @baz(i8* byval %a) +; CHECK-NEXT: call void @baz(i8* byval getelementptr inbounds (%T* @G, i64 0, i32 0)) ret void } @@ -118,8 +110,7 @@ define void @test6() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast ([2 x %U]* @H to i8*), i64 20, i32 16, i1 false) call void @bar(i8* %a) readonly ; CHECK: @test6 -; CHECK-NEXT: %a = bitcast -; CHECK-NEXT: call void @bar(i8* %a) +; CHECK-NEXT: call void @bar(i8* bitcast ([2 x %U]* @H to i8*)) ret void } @@ -129,8 +120,7 @@ define void @test7() { call void @llvm.memcpy.p0i8.p0i8.i64(i8* %a, i8* bitcast (%U* getelementptr ([2 x %U]* @H, i64 0, i32 0) to i8*), i64 20, i32 4, i1 false) call void @bar(i8* %a) readonly ; CHECK: @test7 -; CHECK-NEXT: %a = bitcast -; CHECK-NEXT: call void @bar(i8* %a) +; CHECK-NEXT: call void @bar(i8* bitcast ([2 x %U]* @H to i8*)) ret void } diff --git a/test/Transforms/InstCombine/memcpy.ll b/test/Transforms/InstCombine/memcpy.ll index 8a2e3aa..3a68ff9 100644 --- a/test/Transforms/InstCombine/memcpy.ll +++ b/test/Transforms/InstCombine/memcpy.ll @@ -1,6 +1,7 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind define void @test1(i8* %a) { tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %a, i32 100, i32 1, i1 false) @@ -17,3 +18,10 @@ define void @test2(i8* %a) { ; CHECK: define void @test2 ; CHECK-NEXT: call void @llvm.memcpy } + +define void @test3(i8* %d, i8* %s) { + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %d, i8* %s, i64 17179869184, i32 4, i1 false) + ret void +; CHECK: define void @test3 +; CHECK-NEXT: call void @llvm.memcpy +} diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll index f5a4581..31a3cb4 100644 --- a/test/Transforms/InstCombine/objsize.ll +++ b/test/Transforms/InstCombine/objsize.ll @@ -171,3 +171,88 @@ define i32 @test8(i8** %esc) { ; CHECK: ret i32 30 ret i32 %objsize } + +declare noalias i8* @strdup(i8* nocapture) nounwind +declare noalias i8* @strndup(i8* nocapture, i32) nounwind + +; CHECK: @test9 +define i32 @test9(i8** %esc) { + %call = tail call i8* @strdup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0)) nounwind + store i8* %call, i8** %esc, align 8 + %1 = tail call i32 @llvm.objectsize.i32(i8* %call, i1 true) +; CHECK: ret i32 8 + ret i32 %1 +} + +; CHECK: @test10 +define i32 @test10(i8** %esc) { + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 3) nounwind + store i8* %call, i8** %esc, align 8 + %1 = tail call i32 @llvm.objectsize.i32(i8* %call, i1 true) +; CHECK: ret i32 4 + ret i32 %1 +} + +; CHECK: @test11 +define i32 @test11(i8** %esc) { + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 7) nounwind + store i8* %call, i8** %esc, align 8 + %1 = tail call i32 @llvm.objectsize.i32(i8* %call, i1 true) +; CHECK: ret i32 8 + ret i32 %1 +} + +; CHECK: @test12 +define i32 @test12(i8** %esc) { + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 8) nounwind + store i8* %call, i8** %esc, align 8 + %1 = tail call i32 @llvm.objectsize.i32(i8* %call, i1 true) +; CHECK: ret i32 8 + ret i32 %1 +} + +; CHECK: @test13 +define i32 @test13(i8** %esc) { + %call = tail call i8* @strndup(i8* getelementptr inbounds ([8 x i8]* @.str, i64 0, i64 0), i32 57) nounwind + store i8* %call, i8** %esc, align 8 + %1 = tail call i32 @llvm.objectsize.i32(i8* %call, i1 true) +; CHECK: ret i32 8 + ret i32 %1 +} + +; CHECK: @PR13390 +define i32 @PR13390(i1 %bool, i8* %a) { +entry: + %cond = or i1 %bool, true + br i1 %cond, label %return, label %xpto + +xpto: + %select = select i1 %bool, i8* %select, i8* %a + %select2 = select i1 %bool, i8* %a, i8* %select2 + %0 = tail call i32 @llvm.objectsize.i32(i8* %select, i1 true) + %1 = tail call i32 @llvm.objectsize.i32(i8* %select2, i1 true) + %2 = add i32 %0, %1 +; CHECK: ret i32 undef + ret i32 %2 + +return: + ret i32 42 +} + +; CHECK: @PR13621 +define i32 @PR13621(i1 %bool) nounwind { +entry: + %cond = or i1 %bool, true + br i1 %cond, label %return, label %xpto + +; technically reachable, but this malformed IR may appear as a result of constant propagation +xpto: + %gep2 = getelementptr i8* %gep, i32 1 + %gep = getelementptr i8* %gep2, i32 1 + %o = call i32 @llvm.objectsize.i32(i8* %gep, i1 true) +; CHECK: ret i32 undef + ret i32 %o + +return: + ret i32 7 +} diff --git a/test/Transforms/InstCombine/select-crash.ll b/test/Transforms/InstCombine/select-crash.ll index 18af152..946ea2b 100644 --- a/test/Transforms/InstCombine/select-crash.ll +++ b/test/Transforms/InstCombine/select-crash.ll @@ -30,3 +30,20 @@ define <4 x float> @foo(i1 %b, <4 x float> %x, <4 x float> %y, <4 x float> %z) { %sel = select i1 %b, <4 x float> %a, <4 x float> %sub ret <4 x float> %sel } + +; CHECK: @test3 +define i32 @test3(i1 %bool, i32 %a) { +entry: + %cond = or i1 %bool, true + br i1 %cond, label %return, label %xpto + +; technically reachable, but this malformed IR may appear as a result of constant propagation +xpto: + %select = select i1 %bool, i32 %a, i32 %select + %select2 = select i1 %bool, i32 %select2, i32 %a + %sum = add i32 %select, %select2 + ret i32 %sum + +return: + ret i32 7 +} diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll index cc63371..0019a57 100644 --- a/test/Transforms/InstCombine/vec_demanded_elts.ll +++ b/test/Transforms/InstCombine/vec_demanded_elts.ll @@ -162,4 +162,51 @@ entry: ret <4 x float> %shuffle9.i } +define <2 x float> @test_fptrunc(double %f) { +; CHECK: @test_fptrunc +; CHECK: insertelement +; CHECK: insertelement +; CHECK-NOT: insertelement + %tmp9 = insertelement <4 x double> undef, double %f, i32 0 + %tmp10 = insertelement <4 x double> %tmp9, double 0.000000e+00, i32 1 + %tmp11 = insertelement <4 x double> %tmp10, double 0.000000e+00, i32 2 + %tmp12 = insertelement <4 x double> %tmp11, double 0.000000e+00, i32 3 + %tmp5 = fptrunc <4 x double> %tmp12 to <4 x float> + %ret = shufflevector <4 x float> %tmp5, <4 x float> undef, <2 x i32> <i32 0, i32 1> + ret <2 x float> %ret +} + +define <2 x double> @test_fpext(float %f) { +; CHECK: @test_fpext +; CHECK: insertelement +; CHECK: insertelement +; CHECK-NOT: insertelement + %tmp9 = insertelement <4 x float> undef, float %f, i32 0 + %tmp10 = insertelement <4 x float> %tmp9, float 0.000000e+00, i32 1 + %tmp11 = insertelement <4 x float> %tmp10, float 0.000000e+00, i32 2 + %tmp12 = insertelement <4 x float> %tmp11, float 0.000000e+00, i32 3 + %tmp5 = fpext <4 x float> %tmp12 to <4 x double> + %ret = shufflevector <4 x double> %tmp5, <4 x double> undef, <2 x i32> <i32 0, i32 1> + ret <2 x double> %ret +} + +define <4 x float> @test_select(float %f, float %g) { +; CHECK: @test_select +; CHECK: %a0 = insertelement <4 x float> undef, float %f, i32 0 +; CHECK-NOT: insertelement +; CHECK: %a3 = insertelement <4 x float> %a0, float 3.000000e+00, i32 3 +; CHECK-NOT: insertelement +; CHECK: %ret = select <4 x i1> <i1 true, i1 false, i1 false, i1 true>, <4 x float> %a3, <4 x float> <float undef, float 4.000000e+00, float 5.000000e+00, float undef> + %a0 = insertelement <4 x float> undef, float %f, i32 0 + %a1 = insertelement <4 x float> %a0, float 1.000000e+00, i32 1 + %a2 = insertelement <4 x float> %a1, float 2.000000e+00, i32 2 + %a3 = insertelement <4 x float> %a2, float 3.000000e+00, i32 3 + %b0 = insertelement <4 x float> undef, float %g, i32 0 + %b1 = insertelement <4 x float> %b0, float 4.000000e+00, i32 1 + %b2 = insertelement <4 x float> %b1, float 5.000000e+00, i32 2 + %b3 = insertelement <4 x float> %b2, float 6.000000e+00, i32 3 + %ret = select <4 x i1> <i1 true, i1 false, i1 false, i1 true>, <4 x float> %a3, <4 x float> %b3 + ret <4 x float> %ret +} + diff --git a/test/Transforms/LICM/promote-order.ll b/test/Transforms/LICM/promote-order.ll new file mode 100644 index 0000000..b016265 --- /dev/null +++ b/test/Transforms/LICM/promote-order.ll @@ -0,0 +1,41 @@ +; RUN: opt -tbaa -basicaa -licm -S < %s | FileCheck %s + +; LICM should keep the stores in their original order when it sinks/promotes them. +; rdar://12045203 + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" +target triple = "x86_64-apple-macosx10.8.0" + +@p = external global i8* + +define i32* @_Z4doiti(i32 %n, float* %tmp1, i32* %tmp3) nounwind { +entry: + %cmp1 = icmp slt i32 0, %n + br i1 %cmp1, label %for.body.lr.ph, label %for.end + +for.body.lr.ph: ; preds = %entry + br label %for.body + +for.body: ; preds = %for.body, %for.body.lr.ph + %i.02 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ] + store float 1.000000e+00, float* %tmp1, align 4, !tbaa !1 + store i32 1, i32* %tmp3, align 4, !tbaa !2 + %inc = add nsw i32 %i.02, 1 + %cmp = icmp slt i32 %inc, %n + br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge + +; CHECK: for.cond.for.end_crit_edge: +; CHECK: store float 1.000000e+00, float* %tmp1 +; CHECK: store i32 1, i32* %tmp3 +for.cond.for.end_crit_edge: ; preds = %for.body + %split = phi i32* [ %tmp3, %for.body ] + br label %for.end + +for.end: ; preds = %for.cond.for.end_crit_edge, %entry + %r.0.lcssa = phi i32* [ %split, %for.cond.for.end_crit_edge ], [ undef, %entry ] + ret i32* %r.0.lcssa +} + +!0 = metadata !{metadata !"minimal TBAA"} +!1 = metadata !{metadata !"float", metadata !0} +!2 = metadata !{metadata !"int", metadata !0} diff --git a/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll b/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll index 70ead33..b5124ea 100644 --- a/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll +++ b/test/Transforms/LoopStrengthReduce/ARM/2012-06-15-lsr-noaddrmode.ll @@ -44,7 +44,7 @@ declare %s* @getstruct() nounwind ; CHECK: @main ; Check that the loop preheader contains no address computation. -; CHECK: %entry +; CHECK: %end_of_chain ; CHECK-NOT: add{{.*}}lsl ; CHECK: ldr{{.*}}lsl #2 ; CHECK: ldr{{.*}}lsl #2 @@ -65,15 +65,15 @@ while.cond: while.body: %v3 = load i32* @ncol, align 4, !tbaa !0 - br label %while.cond.i + br label %end_of_chain -while.cond.i: +end_of_chain: %state.i = getelementptr inbounds %s* %call18, i32 0, i32 0 %v4 = load i32** %state.i, align 4, !tbaa !3 br label %while.cond.i.i while.cond.i.i: - %counter.0.i.i = phi i32 [ %v3, %while.cond.i ], [ %dec.i.i, %land.rhs.i.i ] + %counter.0.i.i = phi i32 [ %v3, %end_of_chain ], [ %dec.i.i, %land.rhs.i.i ] %dec.i.i = add nsw i32 %counter.0.i.i, -1 %tobool.i.i = icmp eq i32 %counter.0.i.i, 0 br i1 %tobool.i.i, label %where.exit, label %land.rhs.i.i diff --git a/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll b/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll index a9b815f..c3b8b89 100644 --- a/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll +++ b/test/Transforms/LoopStrengthReduce/X86/2012-01-13-phielim.ll @@ -99,7 +99,6 @@ while.end: ; preds = %entry ; CHECK: %for.body3.lr.ph.us.i.loopexit ; CHECK-NEXT: in Loop: Header ; CHECK-NEXT: incq -; CHECK-NEXT: .align ; CHECK-NEXT: %for.body3.us.i ; CHECK-NEXT: Inner Loop ; CHECK: testb diff --git a/test/Transforms/ObjCARC/basic.ll b/test/Transforms/ObjCARC/basic.ll index d9bb3f2..0a7ba5d 100644 --- a/test/Transforms/ObjCARC/basic.ll +++ b/test/Transforms/ObjCARC/basic.ll @@ -1272,7 +1272,7 @@ g: ; Delete retain,release pairs around loops. ; CHECK: define void @test39( -; CHECK_NOT: @objc_ +; CHECK-NOT: @objc_ ; CHECK: } define void @test39(i8* %p) { entry: @@ -1290,7 +1290,7 @@ exit: ; preds = %loop ; Delete retain,release pairs around loops containing uses. ; CHECK: define void @test39b( -; CHECK_NOT: @objc_ +; CHECK-NOT: @objc_ ; CHECK: } define void @test39b(i8* %p) { entry: @@ -1309,7 +1309,7 @@ exit: ; preds = %loop ; Delete retain,release pairs around loops containing potential decrements. ; CHECK: define void @test39c( -; CHECK_NOT: @objc_ +; CHECK-NOT: @objc_ ; CHECK: } define void @test39c(i8* %p) { entry: @@ -1329,7 +1329,7 @@ exit: ; preds = %loop ; the successors are in a different order. ; CHECK: define void @test40( -; CHECK_NOT: @objc_ +; CHECK-NOT: @objc_ ; CHECK: } define void @test40(i8* %p) { entry: diff --git a/test/Transforms/ObjCARC/invoke.ll b/test/Transforms/ObjCARC/invoke.ll index 76e82a5..1a58e34 100644 --- a/test/Transforms/ObjCARC/invoke.ll +++ b/test/Transforms/ObjCARC/invoke.ll @@ -76,12 +76,12 @@ done: ; CHECK: define void @test2() { ; CHECK: invoke.cont: ; CHECK-NEXT: call i8* @objc_retain -; CHEK-NOT: @objc +; CHECK-NOT: @objc_r ; CHECK: finally.cont: ; CHECK-NEXT: call void @objc_release -; CHEK-NOT: @objc +; CHECK-NOT: @objc ; CHECK: finally.rethrow: -; CHEK-NOT: @objc +; CHECK-NOT: @objc ; CHECK: } define void @test2() { entry: diff --git a/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll b/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll deleted file mode 100644 index 64aba46..0000000 --- a/test/Transforms/PruneEH/2003-09-14-ExternalCall.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: opt < %s -prune-eh -S | grep invoke - -declare void @External() - -define void @foo() { - invoke void @External( ) - to label %Cont unwind label %Cont -Cont: ; preds = %0, %0 - %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 - cleanup - ret void -} - -declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll b/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll index 1e522e6..2f5a53e 100644 --- a/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll +++ b/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll @@ -1,6 +1,8 @@ ; RUN: opt < %s -reassociate -S | FileCheck %s ; PR12169 ; PR12764 +; XFAIL: * +; Transform disabled until PR13021 is fixed. define i64 @f(i64 %x0) { ; CHECK: @f diff --git a/test/Transforms/Reassociate/mightymul.ll b/test/Transforms/Reassociate/mightymul.ll new file mode 100644 index 0000000..cfbc485 --- /dev/null +++ b/test/Transforms/Reassociate/mightymul.ll @@ -0,0 +1,35 @@ +; RUN: opt < %s -reassociate +; PR13021 + +define i32 @foo(i32 %x) { + %t0 = mul i32 %x, %x + %t1 = mul i32 %t0, %t0 + %t2 = mul i32 %t1, %t1 + %t3 = mul i32 %t2, %t2 + %t4 = mul i32 %t3, %t3 + %t5 = mul i32 %t4, %t4 + %t6 = mul i32 %t5, %t5 + %t7 = mul i32 %t6, %t6 + %t8 = mul i32 %t7, %t7 + %t9 = mul i32 %t8, %t8 + %t10 = mul i32 %t9, %t9 + %t11 = mul i32 %t10, %t10 + %t12 = mul i32 %t11, %t11 + %t13 = mul i32 %t12, %t12 + %t14 = mul i32 %t13, %t13 + %t15 = mul i32 %t14, %t14 + %t16 = mul i32 %t15, %t15 + %t17 = mul i32 %t16, %t16 + %t18 = mul i32 %t17, %t17 + %t19 = mul i32 %t18, %t18 + %t20 = mul i32 %t19, %t19 + %t21 = mul i32 %t20, %t20 + %t22 = mul i32 %t21, %t21 + %t23 = mul i32 %t22, %t22 + %t24 = mul i32 %t23, %t23 + %t25 = mul i32 %t24, %t24 + %t26 = mul i32 %t25, %t25 + %t27 = mul i32 %t26, %t26 + %t28 = mul i32 %t27, %t27 + ret i32 %t28 +} diff --git a/test/Transforms/ScalarRepl/crash.ll b/test/Transforms/ScalarRepl/crash.ll index cd4dc32..58c5a3a 100644 --- a/test/Transforms/ScalarRepl/crash.ll +++ b/test/Transforms/ScalarRepl/crash.ll @@ -260,5 +260,27 @@ entry: ret void } +; rdar://11861001 - The dynamic GEP here was incorrectly making all accesses +; to the alloca think they were also dynamic. Inserts and extracts created to +; access the vector were all being based from the dynamic access, even in BBs +; not dominated by the GEP. +define fastcc void @test() optsize inlinehint ssp align 2 { +entry: + %alloc.0.0 = alloca <4 x float>, align 16 + %bitcast = bitcast <4 x float>* %alloc.0.0 to [4 x float]* + %idx3 = getelementptr inbounds [4 x float]* %bitcast, i32 0, i32 3 + store float 0.000000e+00, float* %idx3, align 4 + br label %for.body10 + +for.body10: ; preds = %for.body10, %entry + %loopidx = phi i32 [ 0, %entry ], [ undef, %for.body10 ] + %unusedidx = getelementptr inbounds <4 x float>* %alloc.0.0, i32 0, i32 %loopidx + br i1 undef, label %for.end, label %for.body10 + +for.end: ; preds = %for.body10 + store <4 x float> <float -1.000000e+00, float -1.000000e+00, float -1.000000e+00, float 0.000000e+00>, <4 x float>* %alloc.0.0, align 16 + ret void +} + declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind diff --git a/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll b/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll deleted file mode 100644 index bc61a75..0000000 --- a/test/Transforms/SimplifyCFG/2003-08-05-MishandleInvoke.ll +++ /dev/null @@ -1,15 +0,0 @@ -; Do not remove the invoke! -; -; RUN: opt < %s -simplifycfg -S | grep invoke - -define i32 @test() { - invoke i32 @test( ) - to label %Ret unwind label %Ret ; <i32>:1 [#uses=0] -Ret: ; preds = %0, %0 - %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - catch i8* null - %A = add i32 0, 1 ; <i32> [#uses=1] - ret i32 %A -} - -declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll deleted file mode 100644 index 27d9d8f..0000000 --- a/test/Transforms/SimplifyCFG/2006-10-29-InvokeCrash.ll +++ /dev/null @@ -1,567 +0,0 @@ -; RUN: opt < %s -simplifycfg -disable-output -; END. - %struct..4._102 = type { %struct.QVectorData* } - %struct..5._125 = type { %struct.QMapData* } - %struct.QAbstractTextDocumentLayout = type { %struct.QObject } - %struct.QBasicAtomic = type { i32 } - %struct.QFont = type { %struct.QFontPrivate*, i32 } - %struct.QFontMetrics = type { %struct.QFontPrivate* } - %struct.QFontPrivate = type opaque - %"struct.QFragmentMap<QTextBlockData>" = type { %struct.QFragmentMapData } - %struct.QFragmentMapData = type { %"struct.QFragmentMapData::._154", i32 } - %"struct.QFragmentMapData::._154" = type { %"struct.QFragmentMapData::Header"* } - %"struct.QFragmentMapData::Header" = type { i32, i32, i32, i32, i32, i32, i32, i32 } - %"struct.QHash<uint,QHashDummyValue>" = type { %"struct.QHash<uint,QHashDummyValue>::._152" } - %"struct.QHash<uint,QHashDummyValue>::._152" = type { %struct.QHashData* } - %struct.QHashData = type { %"struct.QHashData::Node"*, %"struct.QHashData::Node"**, %struct.QBasicAtomic, i32, i32, i16, i16, i32, i8 } - %"struct.QHashData::Node" = type { %"struct.QHashData::Node"*, i32 } - %"struct.QList<QObject*>::._92" = type { %struct.QListData } - %"struct.QList<QPointer<QObject> >" = type { %"struct.QList<QObject*>::._92" } - %struct.QListData = type { %"struct.QListData::Data"* } - %"struct.QListData::Data" = type { %struct.QBasicAtomic, i32, i32, i32, i8, [1 x i8*] } - %"struct.QMap<QUrl,QVariant>" = type { %struct..5._125 } - %struct.QMapData = type { %"struct.QMapData::Node"*, [12 x %"struct.QMapData::Node"*], %struct.QBasicAtomic, i32, i32, i32, i8 } - %"struct.QMapData::Node" = type { %"struct.QMapData::Node"*, [1 x %"struct.QMapData::Node"*] } - %struct.QObject = type { i32 (...)**, %struct.QObjectData* } - %struct.QObjectData = type { i32 (...)**, %struct.QObject*, %struct.QObject*, %"struct.QList<QPointer<QObject> >", i8, [3 x i8], i32, i32 } - %struct.QObjectPrivate = type { %struct.QObjectData, i32, %struct.QObject*, %"struct.QList<QPointer<QObject> >", %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %struct.QString } - %struct.QPaintDevice = type { i32 (...)**, i16 } - %struct.QPainter = type { %struct.QPainterPrivate* } - %struct.QPainterPrivate = type opaque - %struct.QPointF = type { double, double } - %struct.QPrinter = type { %struct.QPaintDevice, %struct.QPrinterPrivate* } - %struct.QPrinterPrivate = type opaque - %struct.QRectF = type { double, double, double, double } - %"struct.QSet<uint>" = type { %"struct.QHash<uint,QHashDummyValue>" } - %"struct.QSharedDataPointer<QTextFormatPrivate>" = type { %struct.QTextFormatPrivate* } - %struct.QString = type { %"struct.QString::Data"* } - %"struct.QString::Data" = type { %struct.QBasicAtomic, i32, i32, i16*, i8, i8, [1 x i16] } - %struct.QTextBlockFormat = type { %struct.QTextFormat } - %struct.QTextBlockGroup = type { %struct.QAbstractTextDocumentLayout } - %struct.QTextDocumentConfig = type { %struct.QString } - %struct.QTextDocumentPrivate = type { %struct.QObjectPrivate, %struct.QString, %"struct.QVector<QAbstractTextDocumentLayout::Selection>", i1, i32, i32, i1, i32, i32, i32, i32, i1, %struct.QTextFormatCollection, %struct.QTextBlockGroup*, %struct.QAbstractTextDocumentLayout*, %"struct.QFragmentMap<QTextBlockData>", %"struct.QFragmentMap<QTextBlockData>", i32, %"struct.QList<QPointer<QObject> >", %"struct.QList<QPointer<QObject> >", %"struct.QMap<QUrl,QVariant>", %"struct.QMap<QUrl,QVariant>", %"struct.QMap<QUrl,QVariant>", %struct.QTextDocumentConfig, i1, i1, %struct.QPointF } - %struct.QTextFormat = type { %"struct.QSharedDataPointer<QTextFormatPrivate>", i32 } - %struct.QTextFormatCollection = type { %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %"struct.QSet<uint>", %struct.QFont } - %struct.QTextFormatPrivate = type opaque - %"struct.QVector<QAbstractTextDocumentLayout::Selection>" = type { %struct..4._102 } - %struct.QVectorData = type { %struct.QBasicAtomic, i32, i32, i8 } - -define void @_ZNK13QTextDocument5printEP8QPrinter(%struct.QAbstractTextDocumentLayout* %this, %struct.QPrinter* %printer) { -entry: - %tmp = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=2] - %tmp.upgrd.1 = alloca %struct.QRectF, align 16 ; <%struct.QRectF*> [#uses=5] - %tmp2 = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=3] - %tmp.upgrd.2 = alloca %struct.QFontMetrics, align 16 ; <%struct.QFontMetrics*> [#uses=4] - %tmp.upgrd.3 = alloca %struct.QFont, align 16 ; <%struct.QFont*> [#uses=4] - %tmp3 = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=2] - %p = alloca %struct.QPainter, align 16 ; <%struct.QPainter*> [#uses=14] - %body = alloca %struct.QRectF, align 16 ; <%struct.QRectF*> [#uses=9] - %pageNumberPos = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=4] - %scaledPageSize = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=6] - %printerPageSize = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=3] - %fmt = alloca %struct.QTextBlockFormat, align 16 ; <%struct.QTextBlockFormat*> [#uses=5] - %font = alloca %struct.QFont, align 16 ; <%struct.QFont*> [#uses=5] - %tmp.upgrd.4 = call %struct.QTextDocumentPrivate* @_ZNK13QTextDocument6d_funcEv( %struct.QAbstractTextDocumentLayout* %this ) ; <%struct.QTextDocumentPrivate*> [#uses=5] - %tmp.upgrd.5 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - call void @_ZN8QPainterC1EP12QPaintDevice( %struct.QPainter* %p, %struct.QPaintDevice* %tmp.upgrd.5 ) - %tmp.upgrd.6 = invoke i1 @_ZNK8QPainter8isActiveEv( %struct.QPainter* %p ) - to label %invcont unwind label %cleanup329 ; <i1> [#uses=1] -invcont: ; preds = %entry - br i1 %tmp.upgrd.6, label %cond_next, label %cleanup328 -cond_next: ; preds = %invcont - %tmp8 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %this ) - to label %invcont7 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=0] -invcont7: ; preds = %cond_next - %tmp10 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1] - call void @_ZN7QPointFC1Edd( %struct.QPointF* %tmp, double 0.000000e+00, double 0.000000e+00 ) - call void @_ZN6QRectFC1ERK7QPointFRK6QSizeF( %struct.QRectF* %body, %struct.QPointF* %tmp, %struct.QPointF* %tmp10 ) - call void @_ZN7QPointFC1Ev( %struct.QPointF* %pageNumberPos ) - %tmp12 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1] - %tmp13 = call i1 @_ZNK6QSizeF7isValidEv( %struct.QPointF* %tmp12 ) ; <i1> [#uses=1] - br i1 %tmp13, label %cond_next15, label %bb -cond_next15: ; preds = %invcont7 - %tmp17 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1] - %tmp.upgrd.7 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %tmp17 ) ; <double> [#uses=1] - %tmp18 = fcmp oeq double %tmp.upgrd.7, 0x41DFFFFFFFC00000 ; <i1> [#uses=1] - br i1 %tmp18, label %bb, label %cond_next20 -cond_next20: ; preds = %cond_next15 - br label %bb21 -bb: ; preds = %cond_next15, %invcont7 - br label %bb21 -bb21: ; preds = %bb, %cond_next20 - %iftmp.406.0 = phi i1 [ false, %bb ], [ true, %cond_next20 ] ; <i1> [#uses=1] - br i1 %iftmp.406.0, label %cond_true24, label %cond_false -cond_true24: ; preds = %bb21 - %tmp.upgrd.8 = invoke i32 @_Z13qt_defaultDpiv( ) - to label %invcont25 unwind label %cleanup329 ; <i32> [#uses=1] -invcont25: ; preds = %cond_true24 - %tmp26 = sitofp i32 %tmp.upgrd.8 to double ; <double> [#uses=2] - %tmp30 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %this ) - to label %invcont29 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=1] -invcont29: ; preds = %invcont25 - %tmp32 = invoke %struct.QPaintDevice* @_ZNK27QAbstractTextDocumentLayout11paintDeviceEv( %struct.QAbstractTextDocumentLayout* %tmp30 ) - to label %invcont31 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=3] -invcont31: ; preds = %invcont29 - %tmp34 = icmp eq %struct.QPaintDevice* %tmp32, null ; <i1> [#uses=1] - br i1 %tmp34, label %cond_next42, label %cond_true35 -cond_true35: ; preds = %invcont31 - %tmp38 = invoke i32 @_ZNK12QPaintDevice11logicalDpiXEv( %struct.QPaintDevice* %tmp32 ) - to label %invcont37 unwind label %cleanup329 ; <i32> [#uses=1] -invcont37: ; preds = %cond_true35 - %tmp38.upgrd.9 = sitofp i32 %tmp38 to double ; <double> [#uses=1] - %tmp41 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp32 ) - to label %invcont40 unwind label %cleanup329 ; <i32> [#uses=1] -invcont40: ; preds = %invcont37 - %tmp41.upgrd.10 = sitofp i32 %tmp41 to double ; <double> [#uses=1] - br label %cond_next42 -cond_next42: ; preds = %invcont40, %invcont31 - %sourceDpiY.2 = phi double [ %tmp41.upgrd.10, %invcont40 ], [ %tmp26, %invcont31 ] ; <double> [#uses=1] - %sourceDpiX.2 = phi double [ %tmp38.upgrd.9, %invcont40 ], [ %tmp26, %invcont31 ] ; <double> [#uses=1] - %tmp44 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp46 = invoke i32 @_ZNK12QPaintDevice11logicalDpiXEv( %struct.QPaintDevice* %tmp44 ) - to label %invcont45 unwind label %cleanup329 ; <i32> [#uses=1] -invcont45: ; preds = %cond_next42 - %tmp46.upgrd.11 = sitofp i32 %tmp46 to double ; <double> [#uses=1] - %tmp48 = fdiv double %tmp46.upgrd.11, %sourceDpiX.2 ; <double> [#uses=2] - %tmp50 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp52 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp50 ) - to label %invcont51 unwind label %cleanup329 ; <i32> [#uses=1] -invcont51: ; preds = %invcont45 - %tmp52.upgrd.12 = sitofp i32 %tmp52 to double ; <double> [#uses=1] - %tmp54 = fdiv double %tmp52.upgrd.12, %sourceDpiY.2 ; <double> [#uses=2] - invoke void @_ZN8QPainter5scaleEdd( %struct.QPainter* %p, double %tmp48, double %tmp54 ) - to label %invcont57 unwind label %cleanup329 -invcont57: ; preds = %invcont51 - %tmp.upgrd.13 = getelementptr %struct.QPointF* %scaledPageSize, i32 0, i32 0 ; <double*> [#uses=1] - %tmp60 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26, i32 0 ; <double*> [#uses=1] - %tmp61 = load double* %tmp60 ; <double> [#uses=1] - store double %tmp61, double* %tmp.upgrd.13 - %tmp62 = getelementptr %struct.QPointF* %scaledPageSize, i32 0, i32 1 ; <double*> [#uses=1] - %tmp63 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26, i32 1 ; <double*> [#uses=1] - %tmp64 = load double* %tmp63 ; <double> [#uses=1] - store double %tmp64, double* %tmp62 - %tmp65 = call double* @_ZN6QSizeF6rwidthEv( %struct.QPointF* %scaledPageSize ) ; <double*> [#uses=2] - %tmp67 = load double* %tmp65 ; <double> [#uses=1] - %tmp69 = fmul double %tmp67, %tmp48 ; <double> [#uses=1] - store double %tmp69, double* %tmp65 - %tmp71 = call double* @_ZN6QSizeF7rheightEv( %struct.QPointF* %scaledPageSize ) ; <double*> [#uses=2] - %tmp73 = load double* %tmp71 ; <double> [#uses=1] - %tmp75 = fmul double %tmp73, %tmp54 ; <double> [#uses=1] - store double %tmp75, double* %tmp71 - %tmp78 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp80 = invoke i32 @_ZNK12QPaintDevice6heightEv( %struct.QPaintDevice* %tmp78 ) - to label %invcont79 unwind label %cleanup329 ; <i32> [#uses=1] -invcont79: ; preds = %invcont57 - %tmp82 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp84 = invoke i32 @_ZNK12QPaintDevice5widthEv( %struct.QPaintDevice* %tmp82 ) - to label %invcont83 unwind label %cleanup329 ; <i32> [#uses=1] -invcont83: ; preds = %invcont79 - %tmp80.upgrd.14 = sitofp i32 %tmp80 to double ; <double> [#uses=1] - %tmp84.upgrd.15 = sitofp i32 %tmp84 to double ; <double> [#uses=1] - call void @_ZN6QSizeFC1Edd( %struct.QPointF* %printerPageSize, double %tmp84.upgrd.15, double %tmp80.upgrd.14 ) - %tmp85 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %printerPageSize ) ; <double> [#uses=1] - %tmp86 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %scaledPageSize ) ; <double> [#uses=1] - %tmp87 = fdiv double %tmp85, %tmp86 ; <double> [#uses=1] - %tmp88 = call double @_ZNK6QSizeF5widthEv( %struct.QPointF* %printerPageSize ) ; <double> [#uses=1] - %tmp89 = call double @_ZNK6QSizeF5widthEv( %struct.QPointF* %scaledPageSize ) ; <double> [#uses=1] - %tmp90 = fdiv double %tmp88, %tmp89 ; <double> [#uses=1] - invoke void @_ZN8QPainter5scaleEdd( %struct.QPainter* %p, double %tmp90, double %tmp87 ) - to label %cond_next194 unwind label %cleanup329 -cond_false: ; preds = %bb21 - %tmp.upgrd.16 = getelementptr %struct.QAbstractTextDocumentLayout* %this, i32 0, i32 0 ; <%struct.QObject*> [#uses=1] - %tmp95 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument5cloneEP7QObject( %struct.QAbstractTextDocumentLayout* %this, %struct.QObject* %tmp.upgrd.16 ) - to label %invcont94 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=9] -invcont94: ; preds = %cond_false - %tmp99 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) - to label %invcont98 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=1] -invcont98: ; preds = %invcont94 - %tmp101 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont100 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=1] -invcont100: ; preds = %invcont98 - invoke void @_ZN27QAbstractTextDocumentLayout14setPaintDeviceEP12QPaintDevice( %struct.QAbstractTextDocumentLayout* %tmp99, %struct.QPaintDevice* %tmp101 ) - to label %invcont103 unwind label %cleanup329 -invcont103: ; preds = %invcont100 - %tmp105 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont104 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=1] -invcont104: ; preds = %invcont103 - %tmp107 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp105 ) - to label %invcont106 unwind label %cleanup329 ; <i32> [#uses=1] -invcont106: ; preds = %invcont104 - %tmp108 = sitofp i32 %tmp107 to double ; <double> [#uses=1] - %tmp109 = fmul double %tmp108, 0x3FE93264C993264C ; <double> [#uses=1] - %tmp109.upgrd.17 = fptosi double %tmp109 to i32 ; <i32> [#uses=3] - %tmp.upgrd.18 = call %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) ; <%struct.QTextBlockGroup*> [#uses=1] - invoke void @_ZNK10QTextFrame11frameFormatEv( %struct.QTextBlockFormat* sret %fmt, %struct.QTextBlockGroup* %tmp.upgrd.18 ) - to label %invcont111 unwind label %cleanup329 -invcont111: ; preds = %invcont106 - %tmp112 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1] - invoke void @_ZN16QTextFrameFormat9setMarginEd( %struct.QTextBlockFormat* %fmt, double %tmp112 ) - to label %invcont114 unwind label %cleanup192 -invcont114: ; preds = %invcont111 - %tmp116 = call %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) ; <%struct.QTextBlockGroup*> [#uses=1] - invoke void @_ZN10QTextFrame14setFrameFormatERK16QTextFrameFormat( %struct.QTextBlockGroup* %tmp116, %struct.QTextBlockFormat* %fmt ) - to label %invcont117 unwind label %cleanup192 -invcont117: ; preds = %invcont114 - %tmp119 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont118 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1] -invcont118: ; preds = %invcont117 - %tmp121 = invoke i32 @_ZNK12QPaintDevice6heightEv( %struct.QPaintDevice* %tmp119 ) - to label %invcont120 unwind label %cleanup192 ; <i32> [#uses=1] -invcont120: ; preds = %invcont118 - %tmp121.upgrd.19 = sitofp i32 %tmp121 to double ; <double> [#uses=1] - %tmp123 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont122 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1] -invcont122: ; preds = %invcont120 - %tmp125 = invoke i32 @_ZNK12QPaintDevice5widthEv( %struct.QPaintDevice* %tmp123 ) - to label %invcont124 unwind label %cleanup192 ; <i32> [#uses=1] -invcont124: ; preds = %invcont122 - %tmp125.upgrd.20 = sitofp i32 %tmp125 to double ; <double> [#uses=1] - call void @_ZN6QRectFC1Edddd( %struct.QRectF* %tmp.upgrd.1, double 0.000000e+00, double 0.000000e+00, double %tmp125.upgrd.20, double %tmp121.upgrd.19 ) - %tmp126 = getelementptr %struct.QRectF* %body, i32 0, i32 0 ; <double*> [#uses=1] - %tmp127 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 0 ; <double*> [#uses=1] - %tmp128 = load double* %tmp127 ; <double> [#uses=1] - store double %tmp128, double* %tmp126 - %tmp129 = getelementptr %struct.QRectF* %body, i32 0, i32 1 ; <double*> [#uses=1] - %tmp130 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 1 ; <double*> [#uses=1] - %tmp131 = load double* %tmp130 ; <double> [#uses=1] - store double %tmp131, double* %tmp129 - %tmp132 = getelementptr %struct.QRectF* %body, i32 0, i32 2 ; <double*> [#uses=1] - %tmp133 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 2 ; <double*> [#uses=1] - %tmp134 = load double* %tmp133 ; <double> [#uses=1] - store double %tmp134, double* %tmp132 - %tmp135 = getelementptr %struct.QRectF* %body, i32 0, i32 3 ; <double*> [#uses=1] - %tmp136 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 3 ; <double*> [#uses=1] - %tmp137 = load double* %tmp136 ; <double> [#uses=1] - store double %tmp137, double* %tmp135 - %tmp138 = call double @_ZNK6QRectF6heightEv( %struct.QRectF* %body ) ; <double> [#uses=1] - %tmp139 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1] - %tmp140 = fsub double %tmp138, %tmp139 ; <double> [#uses=1] - %tmp142 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont141 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1] -invcont141: ; preds = %invcont124 - invoke void @_ZNK13QTextDocument11defaultFontEv( %struct.QFont* sret %tmp.upgrd.3, %struct.QAbstractTextDocumentLayout* %tmp95 ) - to label %invcont144 unwind label %cleanup192 -invcont144: ; preds = %invcont141 - invoke void @_ZN12QFontMetricsC1ERK5QFontP12QPaintDevice( %struct.QFontMetrics* %tmp.upgrd.2, %struct.QFont* %tmp.upgrd.3, %struct.QPaintDevice* %tmp142 ) - to label %invcont146 unwind label %cleanup173 -invcont146: ; preds = %invcont144 - %tmp149 = invoke i32 @_ZNK12QFontMetrics6ascentEv( %struct.QFontMetrics* %tmp.upgrd.2 ) - to label %invcont148 unwind label %cleanup168 ; <i32> [#uses=1] -invcont148: ; preds = %invcont146 - %tmp149.upgrd.21 = sitofp i32 %tmp149 to double ; <double> [#uses=1] - %tmp150 = fadd double %tmp140, %tmp149.upgrd.21 ; <double> [#uses=1] - %tmp152 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont151 unwind label %cleanup168 ; <%struct.QPaintDevice*> [#uses=1] -invcont151: ; preds = %invcont148 - %tmp154 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp152 ) - to label %invcont153 unwind label %cleanup168 ; <i32> [#uses=1] -invcont153: ; preds = %invcont151 - %tmp155 = mul i32 %tmp154, 5 ; <i32> [#uses=1] - %tmp156 = sdiv i32 %tmp155, 72 ; <i32> [#uses=1] - %tmp156.upgrd.22 = sitofp i32 %tmp156 to double ; <double> [#uses=1] - %tmp157 = fadd double %tmp150, %tmp156.upgrd.22 ; <double> [#uses=1] - %tmp158 = call double @_ZNK6QRectF5widthEv( %struct.QRectF* %body ) ; <double> [#uses=1] - %tmp159 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1] - %tmp160 = fsub double %tmp158, %tmp159 ; <double> [#uses=1] - call void @_ZN7QPointFC1Edd( %struct.QPointF* %tmp2, double %tmp160, double %tmp157 ) - %tmp161 = getelementptr %struct.QPointF* %pageNumberPos, i32 0, i32 0 ; <double*> [#uses=1] - %tmp162 = getelementptr %struct.QPointF* %tmp2, i32 0, i32 0 ; <double*> [#uses=1] - %tmp163 = load double* %tmp162 ; <double> [#uses=1] - store double %tmp163, double* %tmp161 - %tmp164 = getelementptr %struct.QPointF* %pageNumberPos, i32 0, i32 1 ; <double*> [#uses=1] - %tmp165 = getelementptr %struct.QPointF* %tmp2, i32 0, i32 1 ; <double*> [#uses=1] - %tmp166 = load double* %tmp165 ; <double> [#uses=1] - store double %tmp166, double* %tmp164 - invoke void @_ZN12QFontMetricsD1Ev( %struct.QFontMetrics* %tmp.upgrd.2 ) - to label %cleanup171 unwind label %cleanup173 -cleanup168: ; preds = %invcont151, %invcont148, %invcont146 - %val168 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN12QFontMetricsD1Ev( %struct.QFontMetrics* %tmp.upgrd.2 ) - to label %cleanup173 unwind label %cleanup173 -cleanup171: ; preds = %invcont153 - invoke void @_ZN5QFontD1Ev( %struct.QFont* %tmp.upgrd.3 ) - to label %finally170 unwind label %cleanup192 -cleanup173: ; preds = %cleanup168, %cleanup168, %invcont153, %invcont144 - %val173 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN5QFontD1Ev( %struct.QFont* %tmp.upgrd.3 ) - to label %cleanup192 unwind label %cleanup192 -finally170: ; preds = %cleanup171 - invoke void @_ZNK13QTextDocument11defaultFontEv( %struct.QFont* sret %font, %struct.QAbstractTextDocumentLayout* %tmp95 ) - to label %invcont177 unwind label %cleanup192 -invcont177: ; preds = %finally170 - invoke void @_ZN5QFont12setPointSizeEi( %struct.QFont* %font, i32 10 ) - to label %invcont179 unwind label %cleanup187 -invcont179: ; preds = %invcont177 - invoke void @_ZN13QTextDocument14setDefaultFontERK5QFont( %struct.QAbstractTextDocumentLayout* %tmp95, %struct.QFont* %font ) - to label %invcont181 unwind label %cleanup187 -invcont181: ; preds = %invcont179 - call void @_ZNK6QRectF4sizeEv( %struct.QPointF* sret %tmp3, %struct.QRectF* %body ) - invoke void @_ZN13QTextDocument11setPageSizeERK6QSizeF( %struct.QAbstractTextDocumentLayout* %tmp95, %struct.QPointF* %tmp3 ) - to label %cleanup185 unwind label %cleanup187 -cleanup185: ; preds = %invcont181 - invoke void @_ZN5QFontD1Ev( %struct.QFont* %font ) - to label %cleanup190 unwind label %cleanup192 -cleanup187: ; preds = %invcont181, %invcont179, %invcont177 - %val187 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN5QFontD1Ev( %struct.QFont* %font ) - to label %cleanup192 unwind label %cleanup192 -cleanup190: ; preds = %cleanup185 - invoke void @_ZN16QTextFrameFormatD1Ev( %struct.QTextBlockFormat* %fmt ) - to label %cond_next194 unwind label %cleanup329 -cleanup192: ; preds = %cleanup187, %cleanup187, %cleanup185, %finally170, %cleanup173, %cleanup173, %cleanup171, %invcont141, %invcont124, %invcont122, %invcont120, %invcont118, %invcont117, %invcont114, %invcont111 - %val192 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN16QTextFrameFormatD1Ev( %struct.QTextBlockFormat* %fmt ) - to label %cleanup329 unwind label %cleanup329 -cond_next194: ; preds = %cleanup190, %invcont83 - %clonedDoc.1 = phi %struct.QAbstractTextDocumentLayout* [ null, %invcont83 ], [ %tmp95, %cleanup190 ] ; <%struct.QAbstractTextDocumentLayout*> [#uses=3] - %doc.1 = phi %struct.QAbstractTextDocumentLayout* [ %this, %invcont83 ], [ %tmp95, %cleanup190 ] ; <%struct.QAbstractTextDocumentLayout*> [#uses=2] - %tmp197 = invoke i1 @_ZNK8QPrinter13collateCopiesEv( %struct.QPrinter* %printer ) - to label %invcont196 unwind label %cleanup329 ; <i1> [#uses=1] -invcont196: ; preds = %cond_next194 - br i1 %tmp197, label %cond_true200, label %cond_false204 -cond_true200: ; preds = %invcont196 - %tmp203 = invoke i32 @_ZNK8QPrinter9numCopiesEv( %struct.QPrinter* %printer ) - to label %invcont202 unwind label %cleanup329 ; <i32> [#uses=1] -invcont202: ; preds = %cond_true200 - br label %cond_next208 -cond_false204: ; preds = %invcont196 - %tmp207 = invoke i32 @_ZNK8QPrinter9numCopiesEv( %struct.QPrinter* %printer ) - to label %invcont206 unwind label %cleanup329 ; <i32> [#uses=1] -invcont206: ; preds = %cond_false204 - br label %cond_next208 -cond_next208: ; preds = %invcont206, %invcont202 - %pageCopies.0 = phi i32 [ %tmp203, %invcont202 ], [ 1, %invcont206 ] ; <i32> [#uses=2] - %docCopies.0 = phi i32 [ 1, %invcont202 ], [ %tmp207, %invcont206 ] ; <i32> [#uses=2] - %tmp211 = invoke i32 @_ZNK8QPrinter8fromPageEv( %struct.QPrinter* %printer ) - to label %invcont210 unwind label %cleanup329 ; <i32> [#uses=3] -invcont210: ; preds = %cond_next208 - %tmp214 = invoke i32 @_ZNK8QPrinter6toPageEv( %struct.QPrinter* %printer ) - to label %invcont213 unwind label %cleanup329 ; <i32> [#uses=3] -invcont213: ; preds = %invcont210 - %tmp216 = icmp eq i32 %tmp211, 0 ; <i1> [#uses=1] - br i1 %tmp216, label %cond_true217, label %cond_next225 -cond_true217: ; preds = %invcont213 - %tmp219 = icmp eq i32 %tmp214, 0 ; <i1> [#uses=1] - br i1 %tmp219, label %cond_true220, label %cond_next225 -cond_true220: ; preds = %cond_true217 - %tmp223 = invoke i32 @_ZNK13QTextDocument9pageCountEv( %struct.QAbstractTextDocumentLayout* %doc.1 ) - to label %invcont222 unwind label %cleanup329 ; <i32> [#uses=1] -invcont222: ; preds = %cond_true220 - br label %cond_next225 -cond_next225: ; preds = %invcont222, %cond_true217, %invcont213 - %toPage.1 = phi i32 [ %tmp223, %invcont222 ], [ %tmp214, %cond_true217 ], [ %tmp214, %invcont213 ] ; <i32> [#uses=2] - %fromPage.1 = phi i32 [ 1, %invcont222 ], [ %tmp211, %cond_true217 ], [ %tmp211, %invcont213 ] ; <i32> [#uses=2] - %tmp.page = invoke i32 @_ZNK8QPrinter9pageOrderEv( %struct.QPrinter* %printer ) - to label %invcont227 unwind label %cleanup329 ; <i32> [#uses=1] -invcont227: ; preds = %cond_next225 - %tmp228 = icmp eq i32 %tmp.page, 1 ; <i1> [#uses=1] - br i1 %tmp228, label %cond_true230, label %cond_next234 -cond_true230: ; preds = %invcont227 - br label %cond_next234 -cond_next234: ; preds = %cond_true230, %invcont227 - %ascending.1 = phi i1 [ false, %cond_true230 ], [ true, %invcont227 ] ; <i1> [#uses=1] - %toPage.2 = phi i32 [ %fromPage.1, %cond_true230 ], [ %toPage.1, %invcont227 ] ; <i32> [#uses=1] - %fromPage.2 = phi i32 [ %toPage.1, %cond_true230 ], [ %fromPage.1, %invcont227 ] ; <i32> [#uses=1] - br label %bb309 -bb237: ; preds = %cond_true313, %cond_next293 - %iftmp.410.4 = phi i1 [ %iftmp.410.5, %cond_true313 ], [ %iftmp.410.1, %cond_next293 ] ; <i1> [#uses=1] - %page.4 = phi i32 [ %fromPage.2, %cond_true313 ], [ %page.3, %cond_next293 ] ; <i32> [#uses=4] - br label %bb273 -invcont240: ; preds = %cond_true277 - %tmp242 = icmp eq i32 %tmp241, 2 ; <i1> [#uses=1] - br i1 %tmp242, label %bb252, label %cond_next244 -cond_next244: ; preds = %invcont240 - %tmp247 = invoke i32 @_ZNK8QPrinter12printerStateEv( %struct.QPrinter* %printer ) - to label %invcont246 unwind label %cleanup329 ; <i32> [#uses=1] -invcont246: ; preds = %cond_next244 - %tmp248 = icmp eq i32 %tmp247, 3 ; <i1> [#uses=1] - br i1 %tmp248, label %bb252, label %bb253 -bb252: ; preds = %invcont246, %invcont240 - br label %bb254 -bb253: ; preds = %invcont246 - br label %bb254 -bb254: ; preds = %bb253, %bb252 - %iftmp.410.0 = phi i1 [ true, %bb252 ], [ false, %bb253 ] ; <i1> [#uses=2] - br i1 %iftmp.410.0, label %UserCanceled, label %cond_next258 -cond_next258: ; preds = %bb254 - invoke fastcc void @_Z9printPageiP8QPainterPK13QTextDocumentRK6QRectFRK7QPointF( i32 %page.4, %struct.QPainter* %p, %struct.QAbstractTextDocumentLayout* %doc.1, %struct.QRectF* %body, %struct.QPointF* %pageNumberPos ) - to label %invcont261 unwind label %cleanup329 -invcont261: ; preds = %cond_next258 - %tmp263 = add i32 %pageCopies.0, -1 ; <i32> [#uses=1] - %tmp265 = icmp sgt i32 %tmp263, %j.4 ; <i1> [#uses=1] - br i1 %tmp265, label %cond_true266, label %cond_next270 -cond_true266: ; preds = %invcont261 - %tmp269 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer ) - to label %cond_next270 unwind label %cleanup329 ; <i1> [#uses=0] -cond_next270: ; preds = %cond_true266, %invcont261 - %tmp272 = add i32 %j.4, 1 ; <i32> [#uses=1] - br label %bb273 -bb273: ; preds = %cond_next270, %bb237 - %iftmp.410.1 = phi i1 [ %iftmp.410.4, %bb237 ], [ %iftmp.410.0, %cond_next270 ] ; <i1> [#uses=2] - %j.4 = phi i32 [ 0, %bb237 ], [ %tmp272, %cond_next270 ] ; <i32> [#uses=3] - %tmp276 = icmp slt i32 %j.4, %pageCopies.0 ; <i1> [#uses=1] - br i1 %tmp276, label %cond_true277, label %bb280 -cond_true277: ; preds = %bb273 - %tmp241 = invoke i32 @_ZNK8QPrinter12printerStateEv( %struct.QPrinter* %printer ) - to label %invcont240 unwind label %cleanup329 ; <i32> [#uses=1] -bb280: ; preds = %bb273 - %tmp283 = icmp eq i32 %page.4, %toPage.2 ; <i1> [#uses=1] - br i1 %tmp283, label %bb297, label %cond_next285 -cond_next285: ; preds = %bb280 - br i1 %ascending.1, label %cond_true287, label %cond_false290 -cond_true287: ; preds = %cond_next285 - %tmp289 = add i32 %page.4, 1 ; <i32> [#uses=1] - br label %cond_next293 -cond_false290: ; preds = %cond_next285 - %tmp292 = add i32 %page.4, -1 ; <i32> [#uses=1] - br label %cond_next293 -cond_next293: ; preds = %cond_false290, %cond_true287 - %page.3 = phi i32 [ %tmp289, %cond_true287 ], [ %tmp292, %cond_false290 ] ; <i32> [#uses=1] - %tmp296 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer ) - to label %bb237 unwind label %cleanup329 ; <i1> [#uses=0] -bb297: ; preds = %bb280 - %tmp299 = add i32 %docCopies.0, -1 ; <i32> [#uses=1] - %tmp301 = icmp sgt i32 %tmp299, %i.1 ; <i1> [#uses=1] - br i1 %tmp301, label %cond_true302, label %cond_next306 -cond_true302: ; preds = %bb297 - %tmp305 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer ) - to label %cond_next306 unwind label %cleanup329 ; <i1> [#uses=0] -cond_next306: ; preds = %cond_true302, %bb297 - %tmp308 = add i32 %i.1, 1 ; <i32> [#uses=1] - br label %bb309 -bb309: ; preds = %cond_next306, %cond_next234 - %iftmp.410.5 = phi i1 [ undef, %cond_next234 ], [ %iftmp.410.1, %cond_next306 ] ; <i1> [#uses=1] - %i.1 = phi i32 [ 0, %cond_next234 ], [ %tmp308, %cond_next306 ] ; <i32> [#uses=3] - %tmp312 = icmp slt i32 %i.1, %docCopies.0 ; <i1> [#uses=1] - br i1 %tmp312, label %cond_true313, label %UserCanceled -cond_true313: ; preds = %bb309 - br label %bb237 -UserCanceled: ; preds = %bb309, %bb254 - %tmp318 = icmp eq %struct.QAbstractTextDocumentLayout* %clonedDoc.1, null ; <i1> [#uses=1] - br i1 %tmp318, label %cleanup327, label %cond_true319 -cond_true319: ; preds = %UserCanceled - %tmp.upgrd.23 = getelementptr %struct.QAbstractTextDocumentLayout* %clonedDoc.1, i32 0, i32 0, i32 0 ; <i32 (...)***> [#uses=1] - %tmp.upgrd.24 = load i32 (...)*** %tmp.upgrd.23 ; <i32 (...)**> [#uses=1] - %tmp322 = getelementptr i32 (...)** %tmp.upgrd.24, i32 4 ; <i32 (...)**> [#uses=1] - %tmp.upgrd.25 = load i32 (...)** %tmp322 ; <i32 (...)*> [#uses=1] - %tmp.upgrd.26 = bitcast i32 (...)* %tmp.upgrd.25 to void (%struct.QAbstractTextDocumentLayout*)* ; <void (%struct.QAbstractTextDocumentLayout*)*> [#uses=1] - invoke void %tmp.upgrd.26( %struct.QAbstractTextDocumentLayout* %clonedDoc.1 ) - to label %cleanup327 unwind label %cleanup329 -cleanup327: ; preds = %cond_true319, %UserCanceled - call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - ret void -cleanup328: ; preds = %invcont - call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - ret void -cleanup329: ; preds = %cond_true319, %cond_true302, %cond_next293, %cond_true277, %cond_true266, %cond_next258, %cond_next244, %cond_next225, %cond_true220, %invcont210, %cond_next208, %cond_false204, %cond_true200, %cond_next194, %cleanup192, %cleanup192, %cleanup190, %invcont106, %invcont104, %invcont103, %invcont100, %invcont98, %invcont94, %cond_false, %invcont83, %invcont79, %invcont57, %invcont51, %invcont45, %cond_next42, %invcont37, %cond_true35, %invcont29, %invcont25, %cond_true24, %cond_next, %entry - %val = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - resume { i8*, i32 } %val -} - -declare void @_ZN6QSizeFC1Edd(%struct.QPointF*, double, double) - -declare i1 @_ZNK6QSizeF7isValidEv(%struct.QPointF*) - -declare double @_ZNK6QSizeF5widthEv(%struct.QPointF*) - -declare double @_ZNK6QSizeF6heightEv(%struct.QPointF*) - -declare double* @_ZN6QSizeF6rwidthEv(%struct.QPointF*) - -declare double* @_ZN6QSizeF7rheightEv(%struct.QPointF*) - -declare %struct.QTextDocumentPrivate* @_ZNK13QTextDocument6d_funcEv(%struct.QAbstractTextDocumentLayout*) - -declare void @_ZN7QPointFC1Ev(%struct.QPointF*) - -declare void @_ZN7QPointFC1Edd(%struct.QPointF*, double, double) - -declare void @_ZN16QTextFrameFormat9setMarginEd(%struct.QTextBlockFormat*, double) - -declare void @_ZN6QRectFC1Edddd(%struct.QRectF*, double, double, double, double) - -declare void @_ZN6QRectFC1ERK7QPointFRK6QSizeF(%struct.QRectF*, %struct.QPointF*, %struct.QPointF*) - -declare double @_ZNK6QRectF5widthEv(%struct.QRectF*) - -declare double @_ZNK6QRectF6heightEv(%struct.QRectF*) - -declare void @_ZNK6QRectF4sizeEv(%struct.QPointF*, %struct.QRectF*) - -declare void @_ZN16QTextFrameFormatD1Ev(%struct.QTextBlockFormat*) - -declare void @_ZNK10QTextFrame11frameFormatEv(%struct.QTextBlockFormat*, %struct.QTextBlockGroup*) - -declare void @_ZN10QTextFrame14setFrameFormatERK16QTextFrameFormat(%struct.QTextBlockGroup*, %struct.QTextBlockFormat*) - -declare i32 @_ZNK12QPaintDevice5widthEv(%struct.QPaintDevice*) - -declare i32 @_ZNK12QPaintDevice6heightEv(%struct.QPaintDevice*) - -declare i32 @_ZNK12QPaintDevice11logicalDpiXEv(%struct.QPaintDevice*) - -declare i32 @_ZNK12QPaintDevice11logicalDpiYEv(%struct.QPaintDevice*) - -declare %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument5cloneEP7QObject(%struct.QAbstractTextDocumentLayout*, %struct.QObject*) - -declare void @_ZN5QFontD1Ev(%struct.QFont*) - -declare %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv(%struct.QAbstractTextDocumentLayout*) - -declare %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv(%struct.QAbstractTextDocumentLayout*) - -declare i32 @_ZNK13QTextDocument9pageCountEv(%struct.QAbstractTextDocumentLayout*) - -declare void @_ZNK13QTextDocument11defaultFontEv(%struct.QFont*, %struct.QAbstractTextDocumentLayout*) - -declare void @_ZN13QTextDocument14setDefaultFontERK5QFont(%struct.QAbstractTextDocumentLayout*, %struct.QFont*) - -declare void @_ZN13QTextDocument11setPageSizeERK6QSizeF(%struct.QAbstractTextDocumentLayout*, %struct.QPointF*) - -declare void @_Z9printPageiP8QPainterPK13QTextDocumentRK6QRectFRK7QPointF(i32, %struct.QPainter*, %struct.QAbstractTextDocumentLayout*, %struct.QRectF*, %struct.QPointF*) - -declare void @_ZN12QFontMetricsD1Ev(%struct.QFontMetrics*) - -declare void @_ZN8QPainterC1EP12QPaintDevice(%struct.QPainter*, %struct.QPaintDevice*) - -declare i1 @_ZNK8QPainter8isActiveEv(%struct.QPainter*) - -declare i32 @_Z13qt_defaultDpiv() - -declare %struct.QPaintDevice* @_ZNK27QAbstractTextDocumentLayout11paintDeviceEv(%struct.QAbstractTextDocumentLayout*) - -declare void @_ZN8QPainter5scaleEdd(%struct.QPainter*, double, double) - -declare %struct.QPaintDevice* @_ZNK8QPainter6deviceEv(%struct.QPainter*) - -declare void @_ZN27QAbstractTextDocumentLayout14setPaintDeviceEP12QPaintDevice(%struct.QAbstractTextDocumentLayout*, %struct.QPaintDevice*) - -declare void @_ZN12QFontMetricsC1ERK5QFontP12QPaintDevice(%struct.QFontMetrics*, %struct.QFont*, %struct.QPaintDevice*) - -declare i32 @_ZNK12QFontMetrics6ascentEv(%struct.QFontMetrics*) - -declare void @_ZN5QFont12setPointSizeEi(%struct.QFont*, i32) - -declare i1 @_ZNK8QPrinter13collateCopiesEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter9numCopiesEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter8fromPageEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter6toPageEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter9pageOrderEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter12printerStateEv(%struct.QPrinter*) - -declare i1 @_ZN8QPrinter7newPageEv(%struct.QPrinter*) - -declare void @_ZN8QPainterD1Ev(%struct.QPainter*) - -declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll b/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll deleted file mode 100644 index abf4455..0000000 --- a/test/Transforms/SimplifyCFG/2009-06-15-InvokeCrash.ll +++ /dev/null @@ -1,569 +0,0 @@ -; RUN: opt < %s -simplifycfg -disable-output -; END. - %struct..4._102 = type { %struct.QVectorData* } - %struct..5._125 = type { %struct.QMapData* } - %struct.QAbstractTextDocumentLayout = type { %struct.QObject } - %struct.QBasicAtomic = type { i32 } - %struct.QFont = type { %struct.QFontPrivate*, i32 } - %struct.QFontMetrics = type { %struct.QFontPrivate* } - %struct.QFontPrivate = type opaque - %"struct.QFragmentMap<QTextBlockData>" = type { %struct.QFragmentMapData } - %struct.QFragmentMapData = type { %"struct.QFragmentMapData::._154", i32 } - %"struct.QFragmentMapData::._154" = type { %"struct.QFragmentMapData::Header"* } - %"struct.QFragmentMapData::Header" = type { i32, i32, i32, i32, i32, i32, i32, i32 } - %"struct.QHash<uint,QHashDummyValue>" = type { %"struct.QHash<uint,QHashDummyValue>::._152" } - %"struct.QHash<uint,QHashDummyValue>::._152" = type { %struct.QHashData* } - %struct.QHashData = type { %"struct.QHashData::Node"*, %"struct.QHashData::Node"**, %struct.QBasicAtomic, i32, i32, i16, i16, i32, i8 } - %"struct.QHashData::Node" = type { %"struct.QHashData::Node"*, i32 } - %"struct.QList<QObject*>::._92" = type { %struct.QListData } - %"struct.QList<QPointer<QObject> >" = type { %"struct.QList<QObject*>::._92" } - %struct.QListData = type { %"struct.QListData::Data"* } - %"struct.QListData::Data" = type { %struct.QBasicAtomic, i32, i32, i32, i8, [1 x i8*] } - %"struct.QMap<QUrl,QVariant>" = type { %struct..5._125 } - %struct.QMapData = type { %"struct.QMapData::Node"*, [12 x %"struct.QMapData::Node"*], %struct.QBasicAtomic, i32, i32, i32, i8 } - %"struct.QMapData::Node" = type { %"struct.QMapData::Node"*, [1 x %"struct.QMapData::Node"*] } - %struct.QObject = type { i32 (...)**, %struct.QObjectData* } - %struct.QObjectData = type { i32 (...)**, %struct.QObject*, %struct.QObject*, %"struct.QList<QPointer<QObject> >", i8, [3 x i8], i32, i32 } - %struct.QObjectPrivate = type { %struct.QObjectData, i32, %struct.QObject*, %"struct.QList<QPointer<QObject> >", %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %struct.QString } - %struct.QPaintDevice = type { i32 (...)**, i16 } - %struct.QPainter = type { %struct.QPainterPrivate* } - %struct.QPainterPrivate = type opaque - %struct.QPointF = type { double, double } - %struct.QPrinter = type { %struct.QPaintDevice, %struct.QPrinterPrivate* } - %struct.QPrinterPrivate = type opaque - %struct.QRectF = type { double, double, double, double } - %"struct.QSet<uint>" = type { %"struct.QHash<uint,QHashDummyValue>" } - %"struct.QSharedDataPointer<QTextFormatPrivate>" = type { %struct.QTextFormatPrivate* } - %struct.QString = type { %"struct.QString::Data"* } - %"struct.QString::Data" = type { %struct.QBasicAtomic, i32, i32, i16*, i8, i8, [1 x i16] } - %struct.QTextBlockFormat = type { %struct.QTextFormat } - %struct.QTextBlockGroup = type { %struct.QAbstractTextDocumentLayout } - %struct.QTextDocumentConfig = type { %struct.QString } - %struct.QTextDocumentPrivate = type { %struct.QObjectPrivate, %struct.QString, %"struct.QVector<QAbstractTextDocumentLayout::Selection>", i1, i32, i32, i1, i32, i32, i32, i32, i1, %struct.QTextFormatCollection, %struct.QTextBlockGroup*, %struct.QAbstractTextDocumentLayout*, %"struct.QFragmentMap<QTextBlockData>", %"struct.QFragmentMap<QTextBlockData>", i32, %"struct.QList<QPointer<QObject> >", %"struct.QList<QPointer<QObject> >", %"struct.QMap<QUrl,QVariant>", %"struct.QMap<QUrl,QVariant>", %"struct.QMap<QUrl,QVariant>", %struct.QTextDocumentConfig, i1, i1, %struct.QPointF } - %struct.QTextFormat = type { %"struct.QSharedDataPointer<QTextFormatPrivate>", i32 } - %struct.QTextFormatCollection = type { %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %"struct.QVector<QAbstractTextDocumentLayout::Selection>", %"struct.QSet<uint>", %struct.QFont } - %struct.QTextFormatPrivate = type opaque - %"struct.QVector<QAbstractTextDocumentLayout::Selection>" = type { %struct..4._102 } - %struct.QVectorData = type { %struct.QBasicAtomic, i32, i32, i8 } - -define void @_ZNK13QTextDocument5printEP8QPrinter(%struct.QAbstractTextDocumentLayout* %this, %struct.QPrinter* %printer) { -entry: - %tmp = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=2] - %tmp.upgrd.1 = alloca %struct.QRectF, align 16 ; <%struct.QRectF*> [#uses=5] - %tmp2 = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=3] - %tmp.upgrd.2 = alloca %struct.QFontMetrics, align 16 ; <%struct.QFontMetrics*> [#uses=4] - %tmp.upgrd.3 = alloca %struct.QFont, align 16 ; <%struct.QFont*> [#uses=4] - %tmp3 = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=2] - %p = alloca %struct.QPainter, align 16 ; <%struct.QPainter*> [#uses=14] - %body = alloca %struct.QRectF, align 16 ; <%struct.QRectF*> [#uses=9] - %foo = alloca double, align 8 - %bar = alloca double, align 8 - %pageNumberPos = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=4] - %scaledPageSize = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=6] - %printerPageSize = alloca %struct.QPointF, align 16 ; <%struct.QPointF*> [#uses=3] - %fmt = alloca %struct.QTextBlockFormat, align 16 ; <%struct.QTextBlockFormat*> [#uses=5] - %font = alloca %struct.QFont, align 16 ; <%struct.QFont*> [#uses=5] - %tmp.upgrd.4 = call %struct.QTextDocumentPrivate* @_ZNK13QTextDocument6d_funcEv( %struct.QAbstractTextDocumentLayout* %this ) ; <%struct.QTextDocumentPrivate*> [#uses=5] - %tmp.upgrd.5 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - call void @_ZN8QPainterC1EP12QPaintDevice( %struct.QPainter* %p, %struct.QPaintDevice* %tmp.upgrd.5 ) - %tmp.upgrd.6 = invoke i1 @_ZNK8QPainter8isActiveEv( %struct.QPainter* %p ) - to label %invcont unwind label %cleanup329 ; <i1> [#uses=1] -invcont: ; preds = %entry - br i1 %tmp.upgrd.6, label %cond_next, label %cleanup328 -cond_next: ; preds = %invcont - %tmp8 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %this ) - to label %invcont7 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=0] -invcont7: ; preds = %cond_next - %tmp10 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1] - call void @_ZN7QPointFC1Edd( %struct.QPointF* %tmp, double 0.000000e+00, double 0.000000e+00 ) - call void @_ZN6QRectFC1ERK7QPointFRK6QSizeF( %struct.QRectF* %body, %struct.QPointF* %tmp, %struct.QPointF* %tmp10 ) - call void @_ZN7QPointFC1Ev( %struct.QPointF* %pageNumberPos ) - %tmp12 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1] - %tmp13 = call i1 @_ZNK6QSizeF7isValidEv( %struct.QPointF* %tmp12 ) ; <i1> [#uses=1] - br i1 %tmp13, label %cond_next15, label %bb -cond_next15: ; preds = %invcont7 - %tmp17 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26 ; <%struct.QPointF*> [#uses=1] - %tmp.upgrd.7 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %tmp17 ) ; <double> [#uses=1] - %tmp18 = fcmp oeq double %tmp.upgrd.7, 0x41DFFFFFFFC00000 ; <i1> [#uses=1] - br i1 %tmp18, label %bb, label %cond_next20 -cond_next20: ; preds = %cond_next15 - br label %bb21 -bb: ; preds = %cond_next15, %invcont7 - br label %bb21 -bb21: ; preds = %bb, %cond_next20 - %iftmp.406.0 = phi i1 [ false, %bb ], [ true, %cond_next20 ] ; <i1> [#uses=1] - br i1 %iftmp.406.0, label %cond_true24, label %cond_false -cond_true24: ; preds = %bb21 - %tmp.upgrd.8 = invoke i32 @_Z13qt_defaultDpiv( ) - to label %invcont25 unwind label %cleanup329 ; <i32> [#uses=1] -invcont25: ; preds = %cond_true24 - %tmp26 = sitofp i32 %tmp.upgrd.8 to double ; <double> [#uses=2] - %tmp30 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %this ) - to label %invcont29 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=1] -invcont29: ; preds = %invcont25 - %tmp32 = invoke %struct.QPaintDevice* @_ZNK27QAbstractTextDocumentLayout11paintDeviceEv( %struct.QAbstractTextDocumentLayout* %tmp30 ) - to label %invcont31 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=3] -invcont31: ; preds = %invcont29 - %tmp34 = icmp eq %struct.QPaintDevice* %tmp32, null ; <i1> [#uses=1] - br i1 %tmp34, label %cond_next42, label %cond_true35 -cond_true35: ; preds = %invcont31 - %tmp38 = invoke i32 @_ZNK12QPaintDevice11logicalDpiXEv( %struct.QPaintDevice* %tmp32 ) - to label %invcont37 unwind label %cleanup329 ; <i32> [#uses=1] -invcont37: ; preds = %cond_true35 - %tmp38.upgrd.9 = sitofp i32 %tmp38 to double ; <double> [#uses=1] - %tmp41 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp32 ) - to label %invcont40 unwind label %cleanup329 ; <i32> [#uses=1] -invcont40: ; preds = %invcont37 - %tmp41.upgrd.10 = sitofp i32 %tmp41 to double ; <double> [#uses=1] - br label %cond_next42 -cond_next42: ; preds = %invcont40, %invcont31 - %sourceDpiY.2 = phi double [ %tmp41.upgrd.10, %invcont40 ], [ %tmp26, %invcont31 ] ; <double> [#uses=1] - %sourceDpiX.2 = phi double [ %tmp38.upgrd.9, %invcont40 ], [ %tmp26, %invcont31 ] ; <double> [#uses=1] - %tmp44 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp46 = invoke i32 @_ZNK12QPaintDevice11logicalDpiXEv( %struct.QPaintDevice* %tmp44 ) - to label %invcont45 unwind label %cleanup329 ; <i32> [#uses=1] -invcont45: ; preds = %cond_next42 - %tmp46.upgrd.11 = sitofp i32 %tmp46 to double ; <double> [#uses=1] - %tmp48 = fdiv double %tmp46.upgrd.11, %sourceDpiX.2 ; <double> [#uses=2] - %tmp50 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp52 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp50 ) - to label %invcont51 unwind label %cleanup329 ; <i32> [#uses=1] -invcont51: ; preds = %invcont45 - %tmp52.upgrd.12 = sitofp i32 %tmp52 to double ; <double> [#uses=1] - %tmp54 = fdiv double %tmp52.upgrd.12, %sourceDpiY.2 ; <double> [#uses=2] - invoke void @_ZN8QPainter5scaleEdd( %struct.QPainter* %p, double %tmp48, double %tmp54 ) - to label %invcont57 unwind label %cleanup329 -invcont57: ; preds = %invcont51 - %tmp.upgrd.13 = getelementptr %struct.QPointF* %scaledPageSize, i32 0, i32 0 ; <double*> [#uses=1] - %tmp60 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26, i32 0 ; <double*> [#uses=1] - %tmp61 = load double* %tmp60 ; <double> [#uses=1] - store double %tmp61, double* %tmp.upgrd.13 - %tmp62 = getelementptr %struct.QPointF* %scaledPageSize, i32 0, i32 1 ; <double*> [#uses=1] - %tmp63 = getelementptr %struct.QTextDocumentPrivate* %tmp.upgrd.4, i32 0, i32 26, i32 1 ; <double*> [#uses=1] - %tmp64 = load double* %tmp63 ; <double> [#uses=1] - store double %tmp64, double* %tmp62 - %tmp65 = call double* @_ZN6QSizeF6rwidthEv( %struct.QPointF* %scaledPageSize ) ; <double*> [#uses=2] - %tmp67 = load double* %tmp65 ; <double> [#uses=1] - %tmp69 = fmul double %tmp67, %tmp48 ; <double> [#uses=1] - store double %tmp69, double* %tmp65 - %tmp71 = call double* @_ZN6QSizeF7rheightEv( %struct.QPointF* %scaledPageSize ) ; <double*> [#uses=2] - %tmp73 = load double* %tmp71 ; <double> [#uses=1] - %tmp75 = fmul double %tmp73, %tmp54 ; <double> [#uses=1] - store double %tmp75, double* %tmp71 - %tmp78 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp80 = invoke i32 @_ZNK12QPaintDevice6heightEv( %struct.QPaintDevice* %tmp78 ) - to label %invcont79 unwind label %cleanup329 ; <i32> [#uses=1] -invcont79: ; preds = %invcont57 - %tmp82 = getelementptr %struct.QPrinter* %printer, i32 0, i32 0 ; <%struct.QPaintDevice*> [#uses=1] - %tmp84 = invoke i32 @_ZNK12QPaintDevice5widthEv( %struct.QPaintDevice* %tmp82 ) - to label %invcont83 unwind label %cleanup329 ; <i32> [#uses=1] -invcont83: ; preds = %invcont79 - %tmp80.upgrd.14 = sitofp i32 %tmp80 to double ; <double> [#uses=1] - %tmp84.upgrd.15 = sitofp i32 %tmp84 to double ; <double> [#uses=1] - call void @_ZN6QSizeFC1Edd( %struct.QPointF* %printerPageSize, double %tmp84.upgrd.15, double %tmp80.upgrd.14 ) - %tmp85 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %printerPageSize ) ; <double> [#uses=1] - %tmp86 = call double @_ZNK6QSizeF6heightEv( %struct.QPointF* %scaledPageSize ) ; <double> [#uses=1] - %tmp87 = fdiv double %tmp85, %tmp86 ; <double> [#uses=1] - %tmp88 = call double @_ZNK6QSizeF5widthEv( %struct.QPointF* %printerPageSize ) ; <double> [#uses=1] - %tmp89 = call double @_ZNK6QSizeF5widthEv( %struct.QPointF* %scaledPageSize ) ; <double> [#uses=1] - %tmp90 = fdiv double %tmp88, %tmp89 ; <double> [#uses=1] - invoke void @_ZN8QPainter5scaleEdd( %struct.QPainter* %p, double %tmp90, double %tmp87 ) - to label %cond_next194 unwind label %cleanup329 -cond_false: ; preds = %bb21 - %tmp.upgrd.16 = getelementptr %struct.QAbstractTextDocumentLayout* %this, i32 0, i32 0 ; <%struct.QObject*> [#uses=1] - %tmp95 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument5cloneEP7QObject( %struct.QAbstractTextDocumentLayout* %this, %struct.QObject* %tmp.upgrd.16 ) - to label %invcont94 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=9] -invcont94: ; preds = %cond_false - %tmp99 = invoke %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) - to label %invcont98 unwind label %cleanup329 ; <%struct.QAbstractTextDocumentLayout*> [#uses=1] -invcont98: ; preds = %invcont94 - %tmp101 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont100 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=1] -invcont100: ; preds = %invcont98 - invoke void @_ZN27QAbstractTextDocumentLayout14setPaintDeviceEP12QPaintDevice( %struct.QAbstractTextDocumentLayout* %tmp99, %struct.QPaintDevice* %tmp101 ) - to label %invcont103 unwind label %cleanup329 -invcont103: ; preds = %invcont100 - %tmp105 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont104 unwind label %cleanup329 ; <%struct.QPaintDevice*> [#uses=1] -invcont104: ; preds = %invcont103 - %tmp107 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp105 ) - to label %invcont106 unwind label %cleanup329 ; <i32> [#uses=1] -invcont106: ; preds = %invcont104 - %tmp108 = sitofp i32 %tmp107 to double ; <double> [#uses=1] - %tmp109 = fmul double %tmp108, 0x3FE93264C993264C ; <double> [#uses=1] - %tmp109.upgrd.17 = fptosi double %tmp109 to i32 ; <i32> [#uses=3] - %tmp.upgrd.18 = call %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) ; <%struct.QTextBlockGroup*> [#uses=1] - invoke void @_ZNK10QTextFrame11frameFormatEv( %struct.QTextBlockFormat* sret %fmt, %struct.QTextBlockGroup* %tmp.upgrd.18 ) - to label %invcont111 unwind label %cleanup329 -invcont111: ; preds = %invcont106 - %tmp112 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1] - invoke void @_ZN16QTextFrameFormat9setMarginEd( %struct.QTextBlockFormat* %fmt, double %tmp112 ) - to label %invcont114 unwind label %cleanup192 -invcont114: ; preds = %invcont111 - %tmp116 = call %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv( %struct.QAbstractTextDocumentLayout* %tmp95 ) ; <%struct.QTextBlockGroup*> [#uses=1] - invoke void @_ZN10QTextFrame14setFrameFormatERK16QTextFrameFormat( %struct.QTextBlockGroup* %tmp116, %struct.QTextBlockFormat* %fmt ) - to label %invcont117 unwind label %cleanup192 -invcont117: ; preds = %invcont114 - %tmp119 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont118 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1] -invcont118: ; preds = %invcont117 - %tmp121 = invoke i32 @_ZNK12QPaintDevice6heightEv( %struct.QPaintDevice* %tmp119 ) - to label %invcont120 unwind label %cleanup192 ; <i32> [#uses=1] -invcont120: ; preds = %invcont118 - %tmp121.upgrd.19 = sitofp i32 %tmp121 to double ; <double> [#uses=1] - %tmp123 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont122 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1] -invcont122: ; preds = %invcont120 - %tmp125 = invoke i32 @_ZNK12QPaintDevice5widthEv( %struct.QPaintDevice* %tmp123 ) - to label %invcont124 unwind label %cleanup192 ; <i32> [#uses=1] -invcont124: ; preds = %invcont122 - %tmp125.upgrd.20 = sitofp i32 %tmp125 to double ; <double> [#uses=1] - call void @_ZN6QRectFC1Edddd( %struct.QRectF* %tmp.upgrd.1, double 0.000000e+00, double 0.000000e+00, double %tmp125.upgrd.20, double %tmp121.upgrd.19 ) - %tmp126 = getelementptr %struct.QRectF* %body, i32 0, i32 0 ; <double*> [#uses=1] - %tmp127 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 0 ; <double*> [#uses=1] - %tmp128 = load double* %tmp127 ; <double> [#uses=1] - store double %tmp128, double* %tmp126 - %tmp129 = getelementptr %struct.QRectF* %body, i32 0, i32 1 ; <double*> [#uses=1] - %tmp130 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 1 ; <double*> [#uses=1] - %tmp131 = load double* %tmp130 ; <double> [#uses=1] - store double %tmp131, double* %tmp129 - %tmp132 = getelementptr %struct.QRectF* %body, i32 0, i32 2 ; <double*> [#uses=1] - %tmp133 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 2 ; <double*> [#uses=1] - %tmp134 = load double* %tmp133 ; <double> [#uses=1] - store double %tmp134, double* %tmp132 - %tmp135 = getelementptr %struct.QRectF* %body, i32 0, i32 3 ; <double*> [#uses=1] - %tmp136 = getelementptr %struct.QRectF* %tmp.upgrd.1, i32 0, i32 3 ; <double*> [#uses=1] - %tmp137 = load double* %tmp136 ; <double> [#uses=1] - store double %tmp137, double* %tmp135 - %tmp138 = call double @_ZNK6QRectF6heightEv( %struct.QRectF* %body ) ; <double> [#uses=1] - %tmp139 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1] - %tmp140 = fsub double %tmp138, %tmp139 ; <double> [#uses=1] - %tmp142 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont141 unwind label %cleanup192 ; <%struct.QPaintDevice*> [#uses=1] -invcont141: ; preds = %invcont124 - invoke void @_ZNK13QTextDocument11defaultFontEv( %struct.QFont* sret %tmp.upgrd.3, %struct.QAbstractTextDocumentLayout* %tmp95 ) - to label %invcont144 unwind label %cleanup192 -invcont144: ; preds = %invcont141 - invoke void @_ZN12QFontMetricsC1ERK5QFontP12QPaintDevice( %struct.QFontMetrics* %tmp.upgrd.2, %struct.QFont* %tmp.upgrd.3, %struct.QPaintDevice* %tmp142 ) - to label %invcont146 unwind label %cleanup173 -invcont146: ; preds = %invcont144 - %tmp149 = invoke i32 @_ZNK12QFontMetrics6ascentEv( %struct.QFontMetrics* %tmp.upgrd.2 ) - to label %invcont148 unwind label %cleanup168 ; <i32> [#uses=1] -invcont148: ; preds = %invcont146 - %tmp149.upgrd.21 = sitofp i32 %tmp149 to double ; <double> [#uses=1] - %tmp150 = fadd double %tmp140, %tmp149.upgrd.21 ; <double> [#uses=1] - %tmp152 = invoke %struct.QPaintDevice* @_ZNK8QPainter6deviceEv( %struct.QPainter* %p ) - to label %invcont151 unwind label %cleanup168 ; <%struct.QPaintDevice*> [#uses=1] -invcont151: ; preds = %invcont148 - %tmp154 = invoke i32 @_ZNK12QPaintDevice11logicalDpiYEv( %struct.QPaintDevice* %tmp152 ) - to label %invcont153 unwind label %cleanup168 ; <i32> [#uses=1] -invcont153: ; preds = %invcont151 - %tmp155 = mul i32 %tmp154, 5 ; <i32> [#uses=1] - %tmp156 = sdiv i32 %tmp155, 72 ; <i32> [#uses=1] - %tmp156.upgrd.22 = sitofp i32 %tmp156 to double ; <double> [#uses=1] - %tmp157 = fadd double %tmp150, %tmp156.upgrd.22 ; <double> [#uses=1] - %tmp158 = call double @_ZNK6QRectF5widthEv( %struct.QRectF* %body ) ; <double> [#uses=1] - %tmp159 = sitofp i32 %tmp109.upgrd.17 to double ; <double> [#uses=1] - %tmp160 = fsub double %tmp158, %tmp159 ; <double> [#uses=1] - call void @_ZN7QPointFC1Edd( %struct.QPointF* %tmp2, double %tmp160, double %tmp157 ) - %tmp161 = getelementptr %struct.QPointF* %pageNumberPos, i32 0, i32 0 ; <double*> [#uses=1] - %tmp162 = getelementptr %struct.QPointF* %tmp2, i32 0, i32 0 ; <double*> [#uses=1] - %tmp163 = load double* %tmp162 ; <double> [#uses=1] - store double %tmp163, double* %tmp161 - %tmp164 = getelementptr %struct.QPointF* %pageNumberPos, i32 0, i32 1 ; <double*> [#uses=1] - %tmp165 = getelementptr %struct.QPointF* %tmp2, i32 0, i32 1 ; <double*> [#uses=1] - %tmp166 = load double* %tmp165 ; <double> [#uses=1] - store double %tmp166, double* %tmp164 - invoke void @_ZN12QFontMetricsD1Ev( %struct.QFontMetrics* %tmp.upgrd.2 ) - to label %cleanup171 unwind label %cleanup173 -cleanup168: ; preds = %invcont151, %invcont148, %invcont146 - %val168 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN12QFontMetricsD1Ev( %struct.QFontMetrics* %tmp.upgrd.2 ) - to label %cleanup173 unwind label %cleanup173 -cleanup171: ; preds = %invcont153 - invoke void @_ZN5QFontD1Ev( %struct.QFont* %tmp.upgrd.3 ) - to label %finally170 unwind label %cleanup192 -cleanup173: ; preds = %cleanup168, %cleanup168, %invcont153, %invcont144 - %val173 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN5QFontD1Ev( %struct.QFont* %tmp.upgrd.3 ) - to label %cleanup192 unwind label %cleanup192 -finally170: ; preds = %cleanup171 - invoke void @_ZNK13QTextDocument11defaultFontEv( %struct.QFont* sret %font, %struct.QAbstractTextDocumentLayout* %tmp95 ) - to label %invcont177 unwind label %cleanup192 -invcont177: ; preds = %finally170 - invoke void @_ZN5QFont12setPointSizeEi( %struct.QFont* %font, i32 10 ) - to label %invcont179 unwind label %cleanup187 -invcont179: ; preds = %invcont177 - invoke void @_ZN13QTextDocument14setDefaultFontERK5QFont( %struct.QAbstractTextDocumentLayout* %tmp95, %struct.QFont* %font ) - to label %invcont181 unwind label %cleanup187 -invcont181: ; preds = %invcont179 - call void @_ZNK6QRectF4sizeEv( %struct.QPointF* sret %tmp3, %struct.QRectF* %body ) - invoke void @_ZN13QTextDocument11setPageSizeERK6QSizeF( %struct.QAbstractTextDocumentLayout* %tmp95, %struct.QPointF* %tmp3 ) - to label %cleanup185 unwind label %cleanup187 -cleanup185: ; preds = %invcont181 - invoke void @_ZN5QFontD1Ev( %struct.QFont* %font ) - to label %cleanup190 unwind label %cleanup192 -cleanup187: ; preds = %invcont181, %invcont179, %invcont177 - %val187 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN5QFontD1Ev( %struct.QFont* %font ) - to label %cleanup192 unwind label %cleanup192 -cleanup190: ; preds = %cleanup185 - invoke void @_ZN16QTextFrameFormatD1Ev( %struct.QTextBlockFormat* %fmt ) - to label %cond_next194 unwind label %cleanup329 -cleanup192: ; preds = %cleanup187, %cleanup187, %cleanup185, %finally170, %cleanup173, %cleanup173, %cleanup171, %invcont141, %invcont124, %invcont122, %invcont120, %invcont118, %invcont117, %invcont114, %invcont111 - %val192 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - invoke void @_ZN16QTextFrameFormatD1Ev( %struct.QTextBlockFormat* %fmt ) - to label %cleanup329 unwind label %cleanup329 -cond_next194: ; preds = %cleanup190, %invcont83 - %clonedDoc.1 = phi %struct.QAbstractTextDocumentLayout* [ null, %invcont83 ], [ %tmp95, %cleanup190 ] ; <%struct.QAbstractTextDocumentLayout*> [#uses=3] - %doc.1 = phi %struct.QAbstractTextDocumentLayout* [ %this, %invcont83 ], [ %tmp95, %cleanup190 ] ; <%struct.QAbstractTextDocumentLayout*> [#uses=2] - %tmp197 = invoke i1 @_ZNK8QPrinter13collateCopiesEv( %struct.QPrinter* %printer ) - to label %invcont196 unwind label %cleanup329 ; <i1> [#uses=1] -invcont196: ; preds = %cond_next194 - br i1 %tmp197, label %cond_true200, label %cond_false204 -cond_true200: ; preds = %invcont196 - %tmp2000 = load double* %foo - store double %tmp2000, double* %bar - %tmp203 = invoke i32 @_ZNK8QPrinter9numCopiesEv( %struct.QPrinter* %printer ) - to label %cond_next208 unwind label %cleanup329 ; <i32> [#uses=1] -cond_false204: ; preds = %invcont196 - %tmp2001 = load double* %foo - store double %tmp2001, double* %bar - %tmp207 = invoke i32 @_ZNK8QPrinter9numCopiesEv( %struct.QPrinter* %printer ) - to label %cond_next208 unwind label %cleanup329 ; <i32> [#uses=1] -cond_next208: ; preds = %invcont206, %invcont202 - %pageCopies.0 = phi i32 [ %tmp203, %cond_true200 ], [ 1, %cond_false204 ] ; <i32> [#uses=2] - %docCopies.0 = phi i32 [ 1, %cond_true200 ], [ %tmp207, %cond_false204 ] ; <i32> [#uses=2] - %tmp211 = invoke i32 @_ZNK8QPrinter8fromPageEv( %struct.QPrinter* %printer ) - to label %invcont210 unwind label %cleanup329 ; <i32> [#uses=3] -invcont210: ; preds = %cond_next208 - %tmp214 = invoke i32 @_ZNK8QPrinter6toPageEv( %struct.QPrinter* %printer ) - to label %invcont213 unwind label %cleanup329 ; <i32> [#uses=3] -invcont213: ; preds = %invcont210 - %tmp216 = icmp eq i32 %tmp211, 0 ; <i1> [#uses=1] - br i1 %tmp216, label %cond_true217, label %cond_next225 -cond_true217: ; preds = %invcont213 - %tmp219 = icmp eq i32 %tmp214, 0 ; <i1> [#uses=1] - br i1 %tmp219, label %cond_true220, label %cond_next225 -cond_true220: ; preds = %cond_true217 - %tmp223 = invoke i32 @_ZNK13QTextDocument9pageCountEv( %struct.QAbstractTextDocumentLayout* %doc.1 ) - to label %invcont222 unwind label %cleanup329 ; <i32> [#uses=1] -invcont222: ; preds = %cond_true220 - br label %cond_next225 -cond_next225: ; preds = %invcont222, %cond_true217, %invcont213 - %toPage.1 = phi i32 [ %tmp223, %invcont222 ], [ %tmp214, %cond_true217 ], [ %tmp214, %invcont213 ] ; <i32> [#uses=2] - %fromPage.1 = phi i32 [ 1, %invcont222 ], [ %tmp211, %cond_true217 ], [ %tmp211, %invcont213 ] ; <i32> [#uses=2] - %tmp.page = invoke i32 @_ZNK8QPrinter9pageOrderEv( %struct.QPrinter* %printer ) - to label %invcont227 unwind label %cleanup329 ; <i32> [#uses=1] -invcont227: ; preds = %cond_next225 - %tmp228 = icmp eq i32 %tmp.page, 1 ; <i1> [#uses=1] - br i1 %tmp228, label %cond_true230, label %cond_next234 -cond_true230: ; preds = %invcont227 - br label %cond_next234 -cond_next234: ; preds = %cond_true230, %invcont227 - %ascending.1 = phi i1 [ false, %cond_true230 ], [ true, %invcont227 ] ; <i1> [#uses=1] - %toPage.2 = phi i32 [ %fromPage.1, %cond_true230 ], [ %toPage.1, %invcont227 ] ; <i32> [#uses=1] - %fromPage.2 = phi i32 [ %toPage.1, %cond_true230 ], [ %fromPage.1, %invcont227 ] ; <i32> [#uses=1] - br label %bb309 -bb237: ; preds = %cond_true313, %cond_next293 - %iftmp.410.4 = phi i1 [ %iftmp.410.5, %cond_true313 ], [ %iftmp.410.1, %cond_next293 ] ; <i1> [#uses=1] - %page.4 = phi i32 [ %fromPage.2, %cond_true313 ], [ %page.3, %cond_next293 ] ; <i32> [#uses=4] - br label %bb273 -invcont240: ; preds = %cond_true277 - %tmp242 = icmp eq i32 %tmp241, 2 ; <i1> [#uses=1] - br i1 %tmp242, label %bb252, label %cond_next244 -cond_next244: ; preds = %invcont240 - %tmp247 = invoke i32 @_ZNK8QPrinter12printerStateEv( %struct.QPrinter* %printer ) - to label %invcont246 unwind label %cleanup329 ; <i32> [#uses=1] -invcont246: ; preds = %cond_next244 - %tmp248 = icmp eq i32 %tmp247, 3 ; <i1> [#uses=1] - br i1 %tmp248, label %bb252, label %bb253 -bb252: ; preds = %invcont246, %invcont240 - br label %bb254 -bb253: ; preds = %invcont246 - br label %bb254 -bb254: ; preds = %bb253, %bb252 - %iftmp.410.0 = phi i1 [ true, %bb252 ], [ false, %bb253 ] ; <i1> [#uses=2] - br i1 %iftmp.410.0, label %UserCanceled, label %cond_next258 -cond_next258: ; preds = %bb254 - invoke fastcc void @_Z9printPageiP8QPainterPK13QTextDocumentRK6QRectFRK7QPointF( i32 %page.4, %struct.QPainter* %p, %struct.QAbstractTextDocumentLayout* %doc.1, %struct.QRectF* %body, %struct.QPointF* %pageNumberPos ) - to label %invcont261 unwind label %cleanup329 -invcont261: ; preds = %cond_next258 - %tmp263 = add i32 %pageCopies.0, -1 ; <i32> [#uses=1] - %tmp265 = icmp sgt i32 %tmp263, %j.4 ; <i1> [#uses=1] - br i1 %tmp265, label %cond_true266, label %cond_next270 -cond_true266: ; preds = %invcont261 - %tmp269 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer ) - to label %cond_next270 unwind label %cleanup329 ; <i1> [#uses=0] -cond_next270: ; preds = %cond_true266, %invcont261 - %tmp272 = add i32 %j.4, 1 ; <i32> [#uses=1] - br label %bb273 -bb273: ; preds = %cond_next270, %bb237 - %iftmp.410.1 = phi i1 [ %iftmp.410.4, %bb237 ], [ %iftmp.410.0, %cond_next270 ] ; <i1> [#uses=2] - %j.4 = phi i32 [ 0, %bb237 ], [ %tmp272, %cond_next270 ] ; <i32> [#uses=3] - %tmp276 = icmp slt i32 %j.4, %pageCopies.0 ; <i1> [#uses=1] - br i1 %tmp276, label %cond_true277, label %bb280 -cond_true277: ; preds = %bb273 - %tmp241 = invoke i32 @_ZNK8QPrinter12printerStateEv( %struct.QPrinter* %printer ) - to label %invcont240 unwind label %cleanup329 ; <i32> [#uses=1] -bb280: ; preds = %bb273 - %tmp283 = icmp eq i32 %page.4, %toPage.2 ; <i1> [#uses=1] - br i1 %tmp283, label %bb297, label %cond_next285 -cond_next285: ; preds = %bb280 - br i1 %ascending.1, label %cond_true287, label %cond_false290 -cond_true287: ; preds = %cond_next285 - %tmp289 = add i32 %page.4, 1 ; <i32> [#uses=1] - br label %cond_next293 -cond_false290: ; preds = %cond_next285 - %tmp292 = add i32 %page.4, -1 ; <i32> [#uses=1] - br label %cond_next293 -cond_next293: ; preds = %cond_false290, %cond_true287 - %page.3 = phi i32 [ %tmp289, %cond_true287 ], [ %tmp292, %cond_false290 ] ; <i32> [#uses=1] - %tmp296 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer ) - to label %bb237 unwind label %cleanup329 ; <i1> [#uses=0] -bb297: ; preds = %bb280 - %tmp299 = add i32 %docCopies.0, -1 ; <i32> [#uses=1] - %tmp301 = icmp sgt i32 %tmp299, %i.1 ; <i1> [#uses=1] - br i1 %tmp301, label %cond_true302, label %cond_next306 -cond_true302: ; preds = %bb297 - %tmp305 = invoke i1 @_ZN8QPrinter7newPageEv( %struct.QPrinter* %printer ) - to label %cond_next306 unwind label %cleanup329 ; <i1> [#uses=0] -cond_next306: ; preds = %cond_true302, %bb297 - %tmp308 = add i32 %i.1, 1 ; <i32> [#uses=1] - br label %bb309 -bb309: ; preds = %cond_next306, %cond_next234 - %iftmp.410.5 = phi i1 [ undef, %cond_next234 ], [ %iftmp.410.1, %cond_next306 ] ; <i1> [#uses=1] - %i.1 = phi i32 [ 0, %cond_next234 ], [ %tmp308, %cond_next306 ] ; <i32> [#uses=3] - %tmp312 = icmp slt i32 %i.1, %docCopies.0 ; <i1> [#uses=1] - br i1 %tmp312, label %cond_true313, label %UserCanceled -cond_true313: ; preds = %bb309 - br label %bb237 -UserCanceled: ; preds = %bb309, %bb254 - %tmp318 = icmp eq %struct.QAbstractTextDocumentLayout* %clonedDoc.1, null ; <i1> [#uses=1] - br i1 %tmp318, label %cleanup327, label %cond_true319 -cond_true319: ; preds = %UserCanceled - %tmp.upgrd.23 = getelementptr %struct.QAbstractTextDocumentLayout* %clonedDoc.1, i32 0, i32 0, i32 0 ; <i32 (...)***> [#uses=1] - %tmp.upgrd.24 = load i32 (...)*** %tmp.upgrd.23 ; <i32 (...)**> [#uses=1] - %tmp322 = getelementptr i32 (...)** %tmp.upgrd.24, i32 4 ; <i32 (...)**> [#uses=1] - %tmp.upgrd.25 = load i32 (...)** %tmp322 ; <i32 (...)*> [#uses=1] - %tmp.upgrd.26 = bitcast i32 (...)* %tmp.upgrd.25 to void (%struct.QAbstractTextDocumentLayout*)* ; <void (%struct.QAbstractTextDocumentLayout*)*> [#uses=1] - invoke void %tmp.upgrd.26( %struct.QAbstractTextDocumentLayout* %clonedDoc.1 ) - to label %cleanup327 unwind label %cleanup329 -cleanup327: ; preds = %cond_true319, %UserCanceled - call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - ret void -cleanup328: ; preds = %invcont - call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - ret void -cleanup329: ; preds = %cond_true319, %cond_true302, %cond_next293, %cond_true277, %cond_true266, %cond_next258, %cond_next244, %cond_next225, %cond_true220, %invcont210, %cond_next208, %cond_false204, %cond_true200, %cond_next194, %cleanup192, %cleanup192, %cleanup190, %invcont106, %invcont104, %invcont103, %invcont100, %invcont98, %invcont94, %cond_false, %invcont83, %invcont79, %invcont57, %invcont51, %invcont45, %cond_next42, %invcont37, %cond_true35, %invcont29, %invcont25, %cond_true24, %cond_next, %entry - %val329 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) - cleanup - call void @_ZN8QPainterD1Ev( %struct.QPainter* %p ) - resume { i8*, i32 } %val329 -} - -declare void @_ZN6QSizeFC1Edd(%struct.QPointF*, double, double) - -declare i1 @_ZNK6QSizeF7isValidEv(%struct.QPointF*) - -declare double @_ZNK6QSizeF5widthEv(%struct.QPointF*) - -declare double @_ZNK6QSizeF6heightEv(%struct.QPointF*) - -declare double* @_ZN6QSizeF6rwidthEv(%struct.QPointF*) - -declare double* @_ZN6QSizeF7rheightEv(%struct.QPointF*) - -declare %struct.QTextDocumentPrivate* @_ZNK13QTextDocument6d_funcEv(%struct.QAbstractTextDocumentLayout*) - -declare void @_ZN7QPointFC1Ev(%struct.QPointF*) - -declare void @_ZN7QPointFC1Edd(%struct.QPointF*, double, double) - -declare void @_ZN16QTextFrameFormat9setMarginEd(%struct.QTextBlockFormat*, double) - -declare void @_ZN6QRectFC1Edddd(%struct.QRectF*, double, double, double, double) - -declare void @_ZN6QRectFC1ERK7QPointFRK6QSizeF(%struct.QRectF*, %struct.QPointF*, %struct.QPointF*) - -declare double @_ZNK6QRectF5widthEv(%struct.QRectF*) - -declare double @_ZNK6QRectF6heightEv(%struct.QRectF*) - -declare void @_ZNK6QRectF4sizeEv(%struct.QPointF*, %struct.QRectF*) - -declare void @_ZN16QTextFrameFormatD1Ev(%struct.QTextBlockFormat*) - -declare void @_ZNK10QTextFrame11frameFormatEv(%struct.QTextBlockFormat*, %struct.QTextBlockGroup*) - -declare void @_ZN10QTextFrame14setFrameFormatERK16QTextFrameFormat(%struct.QTextBlockGroup*, %struct.QTextBlockFormat*) - -declare i32 @_ZNK12QPaintDevice5widthEv(%struct.QPaintDevice*) - -declare i32 @_ZNK12QPaintDevice6heightEv(%struct.QPaintDevice*) - -declare i32 @_ZNK12QPaintDevice11logicalDpiXEv(%struct.QPaintDevice*) - -declare i32 @_ZNK12QPaintDevice11logicalDpiYEv(%struct.QPaintDevice*) - -declare %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument5cloneEP7QObject(%struct.QAbstractTextDocumentLayout*, %struct.QObject*) - -declare void @_ZN5QFontD1Ev(%struct.QFont*) - -declare %struct.QAbstractTextDocumentLayout* @_ZNK13QTextDocument14documentLayoutEv(%struct.QAbstractTextDocumentLayout*) - -declare %struct.QTextBlockGroup* @_ZNK13QTextDocument9rootFrameEv(%struct.QAbstractTextDocumentLayout*) - -declare i32 @_ZNK13QTextDocument9pageCountEv(%struct.QAbstractTextDocumentLayout*) - -declare void @_ZNK13QTextDocument11defaultFontEv(%struct.QFont*, %struct.QAbstractTextDocumentLayout*) - -declare void @_ZN13QTextDocument14setDefaultFontERK5QFont(%struct.QAbstractTextDocumentLayout*, %struct.QFont*) - -declare void @_ZN13QTextDocument11setPageSizeERK6QSizeF(%struct.QAbstractTextDocumentLayout*, %struct.QPointF*) - -declare void @_Z9printPageiP8QPainterPK13QTextDocumentRK6QRectFRK7QPointF(i32, %struct.QPainter*, %struct.QAbstractTextDocumentLayout*, %struct.QRectF*, %struct.QPointF*) - -declare void @_ZN12QFontMetricsD1Ev(%struct.QFontMetrics*) - -declare void @_ZN8QPainterC1EP12QPaintDevice(%struct.QPainter*, %struct.QPaintDevice*) - -declare i1 @_ZNK8QPainter8isActiveEv(%struct.QPainter*) - -declare i32 @_Z13qt_defaultDpiv() - -declare %struct.QPaintDevice* @_ZNK27QAbstractTextDocumentLayout11paintDeviceEv(%struct.QAbstractTextDocumentLayout*) - -declare void @_ZN8QPainter5scaleEdd(%struct.QPainter*, double, double) - -declare %struct.QPaintDevice* @_ZNK8QPainter6deviceEv(%struct.QPainter*) - -declare void @_ZN27QAbstractTextDocumentLayout14setPaintDeviceEP12QPaintDevice(%struct.QAbstractTextDocumentLayout*, %struct.QPaintDevice*) - -declare void @_ZN12QFontMetricsC1ERK5QFontP12QPaintDevice(%struct.QFontMetrics*, %struct.QFont*, %struct.QPaintDevice*) - -declare i32 @_ZNK12QFontMetrics6ascentEv(%struct.QFontMetrics*) - -declare void @_ZN5QFont12setPointSizeEi(%struct.QFont*, i32) - -declare i1 @_ZNK8QPrinter13collateCopiesEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter9numCopiesEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter8fromPageEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter6toPageEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter9pageOrderEv(%struct.QPrinter*) - -declare i32 @_ZNK8QPrinter12printerStateEv(%struct.QPrinter*) - -declare i1 @_ZN8QPrinter7newPageEv(%struct.QPrinter*) - -declare void @_ZN8QPainterD1Ev(%struct.QPainter*) - -declare i32 @__gxx_personality_v0(...) diff --git a/test/Transforms/SimplifyLibCalls/floor.ll b/test/Transforms/SimplifyLibCalls/floor.ll index 03dcdf5..93c62c2 100644 --- a/test/Transforms/SimplifyLibCalls/floor.ll +++ b/test/Transforms/SimplifyLibCalls/floor.ll @@ -9,6 +9,8 @@ ; DO-SIMPLIFY: call float @ceilf( ; DO-SIMPLIFY: call float @roundf( ; DO-SIMPLIFY: call float @nearbyintf( +; DO-SIMPLIFY: call float @truncf( +; DO-SIMPLIFY: call float @fabsf( ; C89-SIMPLIFY: call float @floorf( ; C89-SIMPLIFY: call float @ceilf( @@ -19,6 +21,8 @@ ; DONT-SIMPLIFY: call double @ceil( ; DONT-SIMPLIFY: call double @round( ; DONT-SIMPLIFY: call double @nearbyint( +; DONT-SIMPLIFY: call double @trunc( +; DONT-SIMPLIFY: call double @fabs( declare double @floor(double) @@ -28,6 +32,10 @@ declare double @round(double) declare double @nearbyint(double) +declare double @trunc(double) + +declare double @fabs(double) + define float @test_floor(float %C) { %D = fpext float %C to double ; <double> [#uses=1] ; --> floorf @@ -60,3 +68,18 @@ define float @test_nearbyint(float %C) { ret float %F } +define float @test_trunc(float %C) { + %D = fpext float %C to double + ; --> truncf + %E = call double @trunc(double %D) + %F = fptrunc double %E to float + ret float %F +} + +define float @test_fabs(float %C) { + %D = fpext float %C to double + ; --> fabsf + %E = call double @fabs(double %D) + %F = fptrunc double %E to float + ret float %F +} |
