1; RUN: llc < %s -mtriple=bpf -mattr=+alu32 -verify-machineinstrs | FileCheck %s 2; 3; Source: 4; struct __sk_buff { 5; unsigned data; 6; unsigned data_end; 7; }; 8; 9; ptr test(int flag, struct __sk_buff *skb) 10; { 11; ptr p; 12; 13; if (flag) { 14; p = (ptr)(long)skb->data; 15; __asm__ __volatile__("": : :"memory"); 16; } else { 17; p = (ptr)(long)skb->data_end; 18; __asm__ __volatile__("": : :"memory"); 19; } 20; 21; return p; 22; } 23; Compilation flag: 24; clang -target bpf -O2 -S -emit-llvm t.c 25 26%struct.__sk_buff = type { i32, i32 } 27 28define dso_local ptr @test(i32 %flag, ptr nocapture readonly %skb) local_unnamed_addr { 29entry: 30 %tobool = icmp eq i32 %flag, 0 31 br i1 %tobool, label %if.else, label %if.then 32 33if.then: 34 %0 = load i32, ptr %skb, align 4 35 tail call void asm sideeffect "", "~{memory}"() 36 br label %if.end 37 38if.else: 39 %data_end = getelementptr inbounds %struct.__sk_buff, ptr %skb, i64 0, i32 1 40 %1 = load i32, ptr %data_end, align 4 41 tail call void asm sideeffect "", "~{memory}"() 42 br label %if.end 43 44if.end: 45 %p.0.in.in = phi i32 [ %0, %if.then ], [ %1, %if.else ] 46 %p.0.in = zext i32 %p.0.in.in to i64 47 %p.0 = inttoptr i64 %p.0.in to ptr 48 ret ptr %p.0 49} 50 51; CHECK: w0 = *(u32 *)(r2 + 0) 52; CHECK: w0 = *(u32 *)(r2 + 4) 53; CHECK-NOT: r[[#]] = w[[#]] 54; CHECK: exit 55