Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/BPF/remove_truncate_1.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

86 lines
2.4 KiB
LLVM

; RUN: llc < %s -mtriple=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s
; Source code:
; struct xdp_md {
; unsigned data;
; unsigned data_end;
; };
;
; int gbl;
; int xdp_dummy(struct xdp_md *xdp)
; {
; char tmp;
; long addr;
;
; if (gbl) {
; long addr1 = (long)xdp->data;
; tmp = *(char *)addr1;
; if (tmp == 1)
; return 3;
; } else {
; tmp = *(volatile char *)(long)xdp->data_end;
; if (tmp == 1)
; return 2;
; }
; addr = (long)xdp->data;
; tmp = *(volatile char *)addr;
; if (tmp == 0)
; return 1;
; return 0;
; }
%struct.xdp_md = type { i32, i32 }
@gbl = common local_unnamed_addr global i32 0, align 4
; Function Attrs: norecurse nounwind
define i32 @xdp_dummy(ptr nocapture readonly %xdp) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @gbl, align 4
%tobool = icmp eq i32 %0, 0
br i1 %tobool, label %if.else, label %if.then
if.then: ; preds = %entry
%1 = load i32, ptr %xdp, align 4
%conv = zext i32 %1 to i64
%2 = inttoptr i64 %conv to ptr
%3 = load i8, ptr %2, align 1
%cmp = icmp eq i8 %3, 1
br i1 %cmp, label %cleanup20, label %if.end12
; CHECK: r1 = *(u32 *)(r1 + 0)
; CHECK: r2 = *(u8 *)(r1 + 0)
if.else: ; preds = %entry
%data_end = getelementptr inbounds %struct.xdp_md, ptr %xdp, i64 0, i32 1
%4 = load i32, ptr %data_end, align 4
%conv6 = zext i32 %4 to i64
; CHECK: r2 = *(u32 *)(r1 + 4)
%5 = inttoptr i64 %conv6 to ptr
%6 = load volatile i8, ptr %5, align 1
%cmp8 = icmp eq i8 %6, 1
br i1 %cmp8, label %cleanup20, label %if.else.if.end12_crit_edge
if.else.if.end12_crit_edge: ; preds = %if.else
%.pre = load i32, ptr %xdp, align 4
br label %if.end12
; CHECK: r1 = *(u32 *)(r1 + 0)
if.end12: ; preds = %if.else.if.end12_crit_edge, %if.then
%7 = phi i32 [ %.pre, %if.else.if.end12_crit_edge ], [ %1, %if.then ]
%conv14 = zext i32 %7 to i64
; CHECK-NOT: r1 <<= 32
; CHECK-NOT: r1 >>= 32
%8 = inttoptr i64 %conv14 to ptr
%9 = load volatile i8, ptr %8, align 1
; CHECK: r1 = *(u8 *)(r1 + 0)
%cmp16 = icmp eq i8 %9, 0
%.28 = zext i1 %cmp16 to i32
br label %cleanup20
cleanup20: ; preds = %if.then, %if.end12, %if.else
%retval.1 = phi i32 [ 3, %if.then ], [ 2, %if.else ], [ %.28, %if.end12 ]
ret i32 %retval.1
}
attributes #0 = { norecurse nounwind }