File: widen-volatile.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (34 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; Check the volatile load/stores are not widened by HexagonLoadStoreWidening pass

; RUN: llc -mtriple=hexagon -verify-machineinstrs < %s | FileCheck %s

target triple = "hexagon"

; CHECK-LABEL: volatile_loads:
; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}+#0)
; CHECK: r{{[0-9]+}} = memw(r{{[0-9]+}}+#4)
; CHECK-NOT: r{{[0-9]+}} = memd(r{{[0-9]+}}+#0)
define dso_local void @volatile_loads(ptr noundef %dst, ptr noundef %src0) local_unnamed_addr {
entry:
  %0 = load volatile i32, ptr %src0, align 8
  %src1 = getelementptr i8, ptr %src0, i32 4
  %conv = zext i32 %0 to i64
  %1 = load volatile i32, ptr %src1, align 4
  %conv4 = zext i32 %1 to i64
  %shl = shl nuw i64 %conv4, 32
  %or = or disjoint i64 %shl, %conv
  store i64 %or, ptr %dst, align 1
  ret void
}

; CHECK-LABEL: volatile_stores:
; CHECK: memw(r{{[0-9]+}}+#0) = r{{[0-9]+}}
; CHECK: memw(r{{[0-9]+}}+#4) = r{{[0-9]+}}
; CHECK-NOT: memd(r{{[0-9]+}}+#0) = r{{[0-9]+}}
define dso_local void @volatile_stores(ptr noundef %dst0, i32 %a, i32 %b) local_unnamed_addr {
entry:
  store volatile i32 %a, ptr %dst0, align 8
  %dst1 = getelementptr i8, ptr %dst0, i32 4
  store volatile i32 %b, ptr %dst1, align 4
  ret void
}