1 ; RUN: llc < %s -march=bpf -mattr=+alu32 -verify-machineinstrs | FileCheck %s
9 ; void * test(int flag, struct __sk_buff *skb)
14 ; p = (void *)(long)skb->data;
15 ; __asm__ __volatile__("": : :"memory");
17 ; p = (void *)(long)skb->data_end;
18 ; __asm__ __volatile__("": : :"memory");
24 ; clang -target bpf -O2 -S -emit-llvm t.c
26 %struct.__sk_buff = type { i32, i32 }
28 define dso_local i8* @test(i32 %flag, %struct.__sk_buff* nocapture readonly %skb) local_unnamed_addr {
30 %tobool = icmp eq i32 %flag, 0
31 br i1 %tobool, label %if.else, label %if.then
34 %data = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %skb, i64 0, i32 0
35 %0 = load i32, i32* %data, align 4
36 tail call void asm sideeffect "", "~{memory}"()
40 %data_end = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %skb, i64 0, i32 1
41 %1 = load i32, i32* %data_end, align 4
42 tail call void asm sideeffect "", "~{memory}"()
46 %p.0.in.in = phi i32 [ %0, %if.then ], [ %1, %if.else ]
47 %p.0.in = zext i32 %p.0.in.in to i64
48 %p.0 = inttoptr i64 %p.0.in to i8*
52 ; CHECK: w0 = *(u32 *)(r2 + 0)
53 ; CHECK: w0 = *(u32 *)(r2 + 4)
54 ; CHECK-NOT: r[[#]] = w[[#]]