Files
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

66 lines
1.8 KiB
LLVM

; RUN: opt -passes=loop-vectorize -S < %s 2>&1 | FileCheck %s
; Produced from test-case:
;
; void testGuardedInnerLoop(uint32_t *ptr, uint32_t denom, uint32_t numer, uint32_t outer_lim)
; {
; for(uint32_t outer_i = 0; outer_i < outer_lim; ++outer_i) {
; if (denom > 0) {
; const uint32_t lim = numer / denom;
;
; for (uint32_t i = 0; i < lim; ++i)
; ptr[i] = 1;
; }
; }
; }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:1"
target triple = "x86_64-unknown-linux-gnu"
define void @testGuardedInnerLoop(ptr %ptr, i32 %denom, i32 %numer, i32 %outer_lim) {
entry:
%cmp1 = icmp eq i32 %outer_lim, 0
br i1 %cmp1, label %exit, label %loop1.preheader
; Verify that a 'udiv' does not appear between the 'loop1.preheader' label, and
; whatever label comes next.
loop1.preheader:
; CHECK-LABEL: loop1.preheader:
; CHECK-NOT: udiv
; CHECK-LABEL: :
br label %loop1
loop1:
%outer_i = phi i32 [ %inc1, %loop2.exit ], [ 0, %loop1.preheader ]
%0 = add i32 %denom, -1
%1 = icmp ult i32 %0, %numer
br i1 %1, label %loop2.preheader, label %loop2.exit
; Verify that a 'udiv' does appear between the 'loop2.preheader' label, and
; whatever label comes next.
loop2.preheader:
; CHECK-LABEL: loop2.preheader:
; CHECK: udiv
; CHECK-LABEL: :
%lim = udiv i32 %numer, %denom
%2 = zext i32 %lim to i64
br label %loop2
loop2:
%indvar.loop2 = phi i64 [ 0, %loop2.preheader ], [ %indvar.loop2.next, %loop2 ]
%arrayidx = getelementptr inbounds i32, ptr %ptr, i64 %indvar.loop2
store i32 1, ptr %arrayidx, align 4
%indvar.loop2.next = add nuw nsw i64 %indvar.loop2, 1
%cmp2 = icmp ult i64 %indvar.loop2.next, %2
br i1 %cmp2, label %loop2, label %loop2.exit
loop2.exit:
%inc1 = add nuw i32 %outer_i, 1
%exitcond = icmp eq i32 %inc1, %outer_lim
br i1 %exitcond, label %exit, label %loop1
exit:
ret void
}