1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 @data1 = external global [2 x [31 x i8]], align 8
5 @data2 = external global [2 x [91 x i8]], align 8
7 define i32 @Prefer_M4_or_andn(i32 %a0, i32 %a1, i32 %a2) #0 {
8 ; CHECK-LABEL: Prefer_M4_or_andn:
9 ; CHECK: // %bb.0: // %b3
11 ; CHECK-NEXT: r2 = asl(r2,#5)
14 ; CHECK-NEXT: r2 |= and(r0,~r1)
20 ; CHECK-NEXT: jumpr r31
25 %v6 = and i32 %a0, %v4
30 define i32 @Prefer_M4_mpyri_addi(i32 %a0) #0 {
31 ; CHECK-LABEL: Prefer_M4_mpyri_addi:
32 ; CHECK: // %bb.0: // %b1
34 ; CHECK-NEXT: r0 = add(##data1,mpyi(r0,#31))
37 ; CHECK-NEXT: jumpr r31
40 %v2 = getelementptr inbounds [2 x [31 x i8]], ptr @data1, i32 0, i32 %a0
41 %v3 = ptrtoint ptr %v2 to i32
45 define i32 @Prefer_M4_mpyrr_addi(i32 %a0) #0 {
46 ; CHECK-LABEL: Prefer_M4_mpyrr_addi:
47 ; CHECK: // %bb.0: // %b1
49 ; CHECK-NEXT: r1 = #91
52 ; CHECK-NEXT: r0 = add(##data2,mpyi(r0,r1))
55 ; CHECK-NEXT: jumpr r31
58 %v2 = getelementptr inbounds [2 x [91 x i8]], ptr @data2, i32 0, i32 %a0
59 %v3 = ptrtoint ptr %v2 to i32
63 define i32 @Prefer_S2_tstbit_r(i32 %a0, i32 %a1) #0 {
64 ; CHECK-LABEL: Prefer_S2_tstbit_r:
65 ; CHECK: // %bb.0: // %b2
67 ; CHECK-NEXT: p0 = tstbit(r0,r1)
70 ; CHECK-NEXT: r0 = mux(p0,#1,#0)
73 ; CHECK-NEXT: jumpr r31
77 %v4 = and i32 %a0, %v3
78 %v5 = icmp ne i32 %v4, 0
79 %v6 = zext i1 %v5 to i32
83 define i32 @Prefer_S4_ntstbit_r(i32 %a0, i32 %a1) #0 {
84 ; CHECK-LABEL: Prefer_S4_ntstbit_r:
85 ; CHECK: // %bb.0: // %b2
87 ; CHECK-NEXT: p0 = !tstbit(r0,r1)
90 ; CHECK-NEXT: r0 = mux(p0,#1,#0)
93 ; CHECK-NEXT: jumpr r31
97 %v4 = and i32 %a0, %v3
98 %v5 = icmp eq i32 %v4, 0
99 %v6 = zext i1 %v5 to i32
103 define i64 @Prefer_L2_loadrub_io(ptr %a0) #0 {
104 ; CHECK-LABEL: Prefer_L2_loadrub_io:
105 ; CHECK: // %bb.0: // %b1
107 ; CHECK-NEXT: r0 = memub(r0+#65)
110 ; CHECK-NEXT: r1:0 = combine(#0,r0)
113 ; CHECK-NEXT: jumpr r31
116 %v2 = getelementptr i8, ptr %a0, i32 65
117 %v3 = load i8, ptr %v2
118 %v4 = zext i8 %v3 to i64
122 attributes #0 = { optnone noinline nounwind readnone }