1 ; RUN: llc < %s -march=bpf -verify-machineinstrs | FileCheck %s
10 ; int xdp_dummy(struct xdp_md *xdp)
16 ; long addr1 = (long)xdp->data;
17 ; tmp = *(char *)addr1;
21 ; tmp = *(volatile char *)(long)xdp->data_end;
25 ; addr = (long)xdp->data;
26 ; tmp = *(volatile char *)addr;
32 ; unsigned int rol32(unsigned int word, unsigned int shift)
34 ; return (word << shift) | (word >> ((-shift) & 31));
36 %struct.xdp_md = type { i32, i32 }
38 @gbl = common local_unnamed_addr global i32 0, align 4
40 ; Function Attrs: norecurse nounwind
41 define i32 @xdp_dummy(%struct.xdp_md* nocapture readonly) local_unnamed_addr #0 {
42 %2 = load i32, i32* @gbl, align 4
43 %3 = icmp eq i32 %2, 0
44 br i1 %3, label %11, label %4
46 ; <label>:4: ; preds = %1
47 %5 = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %0, i64 0, i32 0
48 %6 = load i32, i32* %5, align 4
49 %7 = zext i32 %6 to i64
50 %8 = inttoptr i64 %7 to i8*
51 %9 = load i8, i8* %8, align 1
52 %10 = icmp eq i8 %9, 1
53 br i1 %10, label %28, label %23
54 ; CHECK: r1 = *(u32 *)(r1 + 0)
55 ; CHECK: r2 = *(u8 *)(r1 + 0)
57 ; <label>:11: ; preds = %1
58 %12 = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %0, i64 0, i32 1
59 %13 = load i32, i32* %12, align 4
60 %14 = zext i32 %13 to i64
61 ; CHECK: r2 = *(u32 *)(r1 + 4)
62 %15 = inttoptr i64 %14 to i8*
63 %16 = load volatile i8, i8* %15, align 1
64 ; CHECK: r2 = *(u8 *)(r2 + 0)
65 %17 = icmp eq i8 %16, 1
66 br i1 %17, label %28, label %18
68 ; <label>:18: ; preds = %11
69 %19 = getelementptr inbounds %struct.xdp_md, %struct.xdp_md* %0, i64 0, i32 0
70 %20 = load i32, i32* %19, align 4
71 %21 = zext i32 %20 to i64
72 %22 = inttoptr i64 %21 to i8*
74 ; CHECK: r1 = *(u32 *)(r1 + 0)
76 ; <label>:23: ; preds = %18, %4
77 %24 = phi i8* [ %22, %18 ], [ %8, %4 ]
78 ; CHECK-NOT: r1 <<= 32
79 ; CHECK-NOT: r1 >>= 32
80 %25 = load volatile i8, i8* %24, align 1
81 ; CHECK: r1 = *(u8 *)(r1 + 0)
82 %26 = icmp eq i8 %25, 0
83 %27 = zext i1 %26 to i32
86 ; <label>:28: ; preds = %4, %23, %11
87 %29 = phi i32 [ 3, %4 ], [ 2, %11 ], [ %27, %23 ]
91 ; Function Attrs: norecurse nounwind readnone
92 define i32 @rol32(i32, i32) local_unnamed_addr #1 {
105 attributes #0 = { norecurse nounwind }
106 attributes #1 = { norecurse nounwind readnone }