1; RUN: opt < %s -mtriple=powerpc64le-unknown-linux-gnu -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s 2 3define float @foo(float* %src, float* %dest, i32 signext %count, i32 signext %cond) { 4; CHECK-LABEL: @foo( 5; CHECK-LABEL: entry: 6; CHECK-NOT: load float 7entry: 8 %cmp = icmp sgt i32 %cond, 10 9 %idxprom = sext i32 %count to i64 10 %arrayidx = getelementptr inbounds float, float* %src, i64 %idxprom 11 br i1 %cmp, label %if.then, label %if.else 12 13; CHECK-LABEL: if.then: 14; CHECK: %0 = load float, float* %arrayidx, align 4 15if.then: ; preds = %entry 16 %0 = load float, float* %arrayidx, align 4 17 %res = fmul float %0, 3.000000e+00 18 br label %if.end 19 20; CHECK-LABEL: if.else: 21; CHECK: %1 = load float, float* %arrayidx, align 4 22; CHECK: store float %1, float* %arrayidx4, align 4 23if.else: ; preds = %entry 24 %1 = load float, float* %arrayidx, align 4 25 %idxprom3 = sext i32 %count to i64 26 %arrayidx4 = getelementptr inbounds float, float* %dest, i64 %idxprom3 27 store float %1, float* %arrayidx4, align 4 28 br label %if.end 29 30if.end: ; preds = %if.else, %if.then 31 %res2.0 = phi float [ %res, %if.then ], [ 0.000000e+00, %if.else ] 32 ret float %res2.0 33} 34