1 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -stop-after branch-folder | FileCheck %s
2 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
4 ; Function Attrs: norecurse nounwind
5 define void @foo(i32 %a, i32 %b, ptr nocapture %foo_arr) #0 {
6 ; CHECK: (load (s32) from %ir.arrayidx1.{{i[1-2]}})
8 %cmp = icmp sgt i32 %a, 0
9 br i1 %cmp, label %if.then, label %if.end
11 if.then: ; preds = %entry
12 %0 = load float, ptr %foo_arr, align 4
13 %arrayidx1.i1 = getelementptr inbounds float, ptr %foo_arr, i64 1
14 %1 = load float, ptr %arrayidx1.i1, align 4
15 %sub.i = fsub float %0, %1
16 store float %sub.i, ptr %foo_arr, align 4
19 if.end: ; preds = %entry
20 %cmp1 = icmp sgt i32 %b, 0
21 br i1 %cmp1, label %if.then2, label %if.end3
23 if.then2: ; preds = %if.end
24 %2 = load float, ptr %foo_arr, align 4
25 %arrayidx1.i2 = getelementptr inbounds float, ptr %foo_arr, i64 1
26 %3 = load float, ptr %arrayidx1.i2, align 4
27 %sub.i3 = fsub float %2, %3
28 store float %sub.i3, ptr %foo_arr, align 4
31 if.end3: ; preds = %if.then2, %if.end, %if.then