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