1 ; Check the volatile load/stores are not widened by HexagonLoadStoreWidening pass
3 ; RUN: llc -mtriple=hexagon -verify-machineinstrs < %s | FileCheck %s
5 target triple = "hexagon"
7 ; CHECK-LABEL: volatile_loads:
8 ; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}+#0)
9 ; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}+#4)
10 ; CHECK-NOT: r{{[0-9]+}} = memd(r{{[0-9]+}}+#0)
11 define dso_local void @volatile_loads(ptr noundef %dst, ptr noundef %src0) local_unnamed_addr {
13 %0 = load volatile i32, ptr %src0, align 8
14 %src1 = getelementptr i8, ptr %src0, i32 4
15 %conv = zext i32 %0 to i64
16 %1 = load volatile i32, ptr %src1, align 4
17 %conv4 = zext i32 %1 to i64
18 %shl = shl nuw i64 %conv4, 32
19 %or = or disjoint i64 %shl, %conv
20 store i64 %or, ptr %dst, align 1
24 ; CHECK-LABEL: volatile_stores:
25 ; CHECK: memw(r{{[0-9]+}}+#0) = r{{[0-9]+}}
26 ; CHECK: memw(r{{[0-9]+}}+#4) = r{{[0-9]+}}
27 ; CHECK-NOT: memd(r{{[0-9]+}}+#0) = r{{[0-9]+}}
28 define dso_local void @volatile_stores(ptr noundef %dst0, i32 %a, i32 %b) local_unnamed_addr {
30 store volatile i32 %a, ptr %dst0, align 8
31 %dst1 = getelementptr i8, ptr %dst0, i32 4
32 store volatile i32 %b, ptr %dst1, align 4