• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -O2 -march=hexagon < %s | FileCheck %s
2; CHECK: mpyi
3; CHECK-NOT: mpyi
4; The mpyis from the two GEPs should be commoned out.
5
6target datalayout = "e-m:e-p:32:32-i64:64-a:0-v32:32-n16:32"
7target triple = "hexagon-unknown--elf"
8
9%struct.s_t = type { %struct.anon, i32 }
10%struct.anon = type { i32, [5 x i32] }
11
12@g = common global [100 x %struct.s_t] zeroinitializer, align 8
13
14; Function Attrs: nounwind
15define void @foo(i32 %x) #0 {
16entry:
17  %cmp = icmp slt i32 %x, 90
18  br i1 %cmp, label %if.then, label %if.else
19
20if.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
23  br label %if.end
24
25if.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
28  br label %if.end
29
30if.end:                                           ; preds = %if.else, %if.then
31  ret void
32}
33
34declare void @bar(i32*) #0
35
36attributes #0 = { nounwind }
37
38