1 ; RUN: llc -march=hexagon -hexagon-eif=0 -disable-machine-sink < %s | FileCheck %s
2 target triple = "hexagon"
4 %struct.0 = type { i16, i16 }
6 @t = external local_unnamed_addr global %struct.0, align 2
8 define void @foo(i32 %p, i16 %x, i16 %y, i16 %z) local_unnamed_addr #0 {
10 %conv90 = trunc i32 %p to i16
11 %call105 = call signext i16 @bar(i16 signext 16384, i16 signext undef) #0
12 %call175 = call signext i16 @bar(i16 signext %conv90, i16 signext 4) #0
13 %call197 = call signext i16 @bar(i16 signext %conv90, i16 signext 4) #0
16 %cmp199 = icmp eq i16 %call197, 0
17 br i1 %cmp199, label %if.then200, label %if.else201
19 ; CHECK-DAG: [[R4:r[0-9]+]] = add
20 ; CHECK-DAG: p0 = cmp.eq(r0,#0)
21 ; CHECK: if (!p0) [[R3:r[0-9]+]] = add(r{{[0-9]+}},#3)
22 ; CHECK-DAG: if (!p0) memh(##t) = [[R3]]
23 ; CHECK-DAG: if (p0) memh(##t) = [[R4]]
24 if.then200: ; preds = %entry
25 store i16 %x1, ptr @t, align 2
26 store i16 %z1, ptr getelementptr inbounds (%struct.0, ptr @t, i32 0, i32 1), align 2
29 if.else201: ; preds = %entry
31 store i16 %y1, ptr @t, align 2
34 if.end202: ; preds = %if.else201, %if.then200
38 declare signext i16 @bar(i16 signext, i16 signext) local_unnamed_addr #0
40 attributes #0 = { "target-cpu"="hexagonv55" }