1 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 ; The mpyis from the two GEPs should be commoned out.
6 target datalayout = "e-m:e-p:32:32-i64:64-a:0-v32:32-n16:32"
7 target triple = "hexagon-unknown--elf"
9 %struct.s_t = type { %struct.anon, i32 }
10 %struct.anon = type { i32, [5 x i32] }
12 @g = common global [100 x %struct.s_t] zeroinitializer, align 8
14 ; Function Attrs: nounwind
15 define void @foo(i32 %x) #0 {
17 %cmp = icmp slt i32 %x, 90
18 br i1 %cmp, label %if.then, label %if.else
20 if.then: ; preds = %entry
21 %arrayidx1 = getelementptr inbounds [100 x %struct.s_t], [100 x %struct.s_t]* @g, i32 0, i32 %x, i32 0, i32 1, i32 2
22 tail call void @bar(i32* %arrayidx1) #0
25 if.else: ; preds = %entry
26 %arrayidx5 = getelementptr inbounds [100 x %struct.s_t], [100 x %struct.s_t]* @g, i32 0, i32 %x, i32 0, i32 1, i32 3
27 tail call void @bar(i32* %arrayidx5) #0
30 if.end: ; preds = %if.else, %if.then
34 declare void @bar(i32*) #0
36 attributes #0 = { nounwind }