xref: /llvm-project/llvm/test/CodeGen/Hexagon/store-AbsSet.ll (revision 2208c97c1bec2512d4e47b6223db6d95a7037956)
1; RUN: llc -mtriple=hexagon < %s
2; REQUIRES: asserts
3
4; Validates correct operand order for absolute-set stores.
5
6%s.0 = type { %s.1, %s.2, %s.3, %s.3, %s.4, [8 x i8] }
7%s.1 = type { i8 }
8%s.2 = type { i8 }
9%s.3 = type { i32 }
10%s.4 = type { i32, i32, i32 }
11
12; Function Attrs: nounwind ssp
13define void @f0(ptr nocapture readonly %a0, i32 %a1) #0 {
14b0:
15  %v1 = load i8, ptr %a0, align 1
16  %v2 = and i32 %a1, 1
17  %v3 = icmp eq i32 %v2, 0
18  br i1 %v3, label %b4, label %b1
19
20b1:                                               ; preds = %b0
21  %v4 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 1, i32 0
22  %v5 = load i8, ptr %v4, align 1
23  %v6 = icmp eq i8 %v5, 0
24  br i1 %v6, label %b3, label %b2
25
26b2:                                               ; preds = %b1
27  %v7 = getelementptr %s.0, ptr %a0, i32 0, i32 2, i32 0
28  %v8 = load i32, ptr %v7, align 4
29  store volatile i32 %v8, ptr inttoptr (i32 -318766672 to ptr), align 16
30  %v9 = getelementptr %s.0, ptr %a0, i32 0, i32 3, i32 0
31  %v10 = load i32, ptr %v9, align 4
32  store volatile i32 %v10, ptr inttoptr (i32 -318766672 to ptr), align 16
33  br label %b3
34
35b3:                                               ; preds = %b2, %b1
36  %v11 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 4, i32 0
37  %v12 = load i32, ptr %v11, align 4
38  %v13 = zext i8 %v1 to i32
39  %v14 = mul nsw i32 %v13, 64
40  %v15 = add nsw i32 %v14, -318111684
41  %v16 = inttoptr i32 %v15 to ptr
42  store volatile i32 %v12, ptr %v16, align 4
43  %v17 = shl i32 1, %v13
44  %v18 = load volatile i32, ptr inttoptr (i32 -318111596 to ptr), align 4
45  %v19 = and i32 %v17, 3
46  %v20 = xor i32 %v19, 3
47  %v21 = and i32 %v18, %v20
48  %v22 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 4, i32 1
49  %v23 = load i32, ptr %v22, align 4
50  %v24 = and i32 %v23, 1
51  %v25 = shl i32 %v24, %v13
52  %v26 = or i32 %v25, %v21
53  store volatile i32 %v26, ptr inttoptr (i32 -318111596 to ptr), align 4
54  %v27 = getelementptr inbounds %s.0, ptr %a0, i32 0, i32 4, i32 2
55  %v28 = load i32, ptr %v27, align 4
56  %v29 = mul nsw i32 %v13, 4
57  %v30 = add nsw i32 %v29, -318111592
58  %v31 = inttoptr i32 %v30 to ptr
59  store volatile i32 %v28, ptr %v31, align 4
60  br label %b4
61
62b4:                                               ; preds = %b3, %b0
63  ret void
64}
65
66attributes #0 = { nounwind ssp }
67