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
96 lines
3.3 KiB
LLVM
96 lines
3.3 KiB
LLVM
; RUN: opt -passes=inline %s -S | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
|
target triple = "thumbv7m-arm-none-eabi"
|
|
|
|
; CHECK-LABEL: void @doCalls
|
|
define void @doCalls(ptr nocapture %p1, ptr nocapture %p2, i32 %n) #0 {
|
|
entry:
|
|
%div = lshr i32 %n, 1
|
|
; CHECK: call void @LoopCall
|
|
tail call void @LoopCall(ptr %p1, ptr %p2, i32 %div) #0
|
|
|
|
%div2 = lshr i32 %n, 2
|
|
; CHECK: call void @LoopCall
|
|
tail call void @LoopCall(ptr %p1, ptr %p2, i32 %div2) #0
|
|
|
|
; CHECK-NOT: call void @LoopCall
|
|
tail call void @LoopCall(ptr %p2, ptr %p1, i32 0) #0
|
|
|
|
; CHECK-NOT: call void @LoopCall_internal
|
|
tail call void @LoopCall_internal(ptr %p1, ptr %p2, i32 %div2) #0
|
|
|
|
%div3 = lshr i32 %n, 4
|
|
; CHECK-NOT: call void @SimpleCall
|
|
tail call void @SimpleCall(ptr %p2, ptr %p1, i32 %div3) #0
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: define void @LoopCall
|
|
define void @LoopCall(ptr nocapture %dest, ptr nocapture readonly %source, i32 %num) #0 {
|
|
entry:
|
|
%c = icmp ne i32 %num, 0
|
|
br i1 %c, label %while.cond, label %while.end
|
|
|
|
while.cond: ; preds = %while.body, %entry
|
|
%num.addr.0 = phi i32 [ %num, %entry ], [ %dec, %while.body ]
|
|
%p_dest.0 = phi ptr [ %dest, %entry ], [ %incdec.ptr2, %while.body ]
|
|
%p_source.0 = phi ptr [ %source, %entry ], [ %incdec.ptr, %while.body ]
|
|
%cmp = icmp eq i32 %num.addr.0, 0
|
|
br i1 %cmp, label %while.end, label %while.body
|
|
|
|
while.body: ; preds = %while.cond
|
|
%incdec.ptr = getelementptr inbounds i8, ptr %p_source.0, i32 1
|
|
%0 = load i8, ptr %p_source.0, align 1
|
|
%1 = trunc i32 %num.addr.0 to i8
|
|
%conv1 = add i8 %0, %1
|
|
%incdec.ptr2 = getelementptr inbounds i8, ptr %p_dest.0, i32 1
|
|
store i8 %conv1, ptr %p_dest.0, align 1
|
|
%dec = add i32 %num.addr.0, -1
|
|
br label %while.cond
|
|
|
|
while.end: ; preds = %while.cond
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL-NOT: define void @LoopCall_internal
|
|
define internal void @LoopCall_internal(ptr nocapture %dest, ptr nocapture readonly %source, i32 %num) #0 {
|
|
entry:
|
|
%c = icmp ne i32 %num, 0
|
|
br i1 %c, label %while.cond, label %while.end
|
|
|
|
while.cond: ; preds = %while.body, %entry
|
|
%num.addr.0 = phi i32 [ %num, %entry ], [ %dec, %while.body ]
|
|
%p_dest.0 = phi ptr [ %dest, %entry ], [ %incdec.ptr2, %while.body ]
|
|
%p_source.0 = phi ptr [ %source, %entry ], [ %incdec.ptr, %while.body ]
|
|
%cmp = icmp eq i32 %num.addr.0, 0
|
|
br i1 %cmp, label %while.end, label %while.body
|
|
|
|
while.body: ; preds = %while.cond
|
|
%incdec.ptr = getelementptr inbounds i8, ptr %p_source.0, i32 1
|
|
%0 = load i8, ptr %p_source.0, align 1
|
|
%1 = trunc i32 %num.addr.0 to i8
|
|
%conv1 = add i8 %0, %1
|
|
%incdec.ptr2 = getelementptr inbounds i8, ptr %p_dest.0, i32 1
|
|
store i8 %conv1, ptr %p_dest.0, align 1
|
|
%dec = add i32 %num.addr.0, -1
|
|
br label %while.cond
|
|
|
|
while.end: ; preds = %while.cond
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: define void @SimpleCall
|
|
define void @SimpleCall(ptr nocapture %dest, ptr nocapture readonly %source, i32 %num) #0 {
|
|
entry:
|
|
%arrayidx = getelementptr inbounds i8, ptr %source, i32 %num
|
|
%0 = load i8, ptr %arrayidx, align 1
|
|
%1 = xor i8 %0, 127
|
|
%arrayidx2 = getelementptr inbounds i8, ptr %dest, i32 %num
|
|
store i8 %1, ptr %arrayidx2, align 1
|
|
ret void
|
|
}
|
|
|
|
attributes #0 = { minsize optsize }
|
|
|