Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/SimpleLoopUnswitch/pr138509.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

55 lines
2.3 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -S -enable-unswitch-cost-multiplier=true -unswitch-parent-blocks-div=1 \
; RUN: -passes="loop-mssa(loop-simplifycfg,licm,loop-rotate,simple-loop-unswitch<nontrivial>),print<loops>" \
; RUN: -disable-output 2>&1 | sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-DIV-1
; RUN: opt < %s -S -enable-unswitch-cost-multiplier=true -unswitch-parent-blocks-div=2 \
; RUN: -passes="loop-mssa(loop-simplifycfg,licm,loop-rotate,simple-loop-unswitch<nontrivial>),print<loops>" \
; RUN: -disable-output 2>&1 | sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-DIV-2
; LOOP-DIV-1-COUNT-6: Loop at depth 1 containing:
; LOOP-DIV-2-COUNT-12: Loop at depth 1 containing:
@a = global i32 0, align 4
@b = global i32 0, align 4
@c = global i32 0, align 4
@d = global i32 0, align 4
define i32 @main() {
entry:
br label %outer.loop.header
outer.loop.header: ; preds = %outer.loop.latch, %entry
br i1 false, label %exit, label %outer.loop.body
outer.loop.body: ; preds = %inner.loop.header, %outer.loop.header
store i32 1, ptr @c, align 4
%cmp = icmp sgt i32 0, -1
br i1 %cmp, label %outer.loop.latch, label %exit
inner.loop.header: ; preds = %outer.loop.latch, %inner.loop.body
%a_val = load i32, ptr @a, align 4
%c_val = load i32, ptr @c, align 4
%mul = mul nsw i32 %c_val, %a_val
store i32 %mul, ptr @b, align 4
%cmp2 = icmp sgt i32 %mul, -1
br i1 %cmp2, label %inner.loop.body, label %outer.loop.body
inner.loop.body: ; preds = %inner.loop.header
%mul2 = mul nsw i32 %c_val, 3
store i32 %mul2, ptr @c, align 4
store i32 %c_val, ptr @d, align 4
%mul3 = mul nsw i32 %c_val, %a_val
%cmp3 = icmp sgt i32 %mul3, -1
br i1 %cmp3, label %inner.loop.header, label %exit
outer.loop.latch: ; preds = %outer.loop.body
%d_val = load i32, ptr @d, align 4
store i32 %d_val, ptr @b, align 4
%cmp4 = icmp eq i32 %d_val, 0
br i1 %cmp4, label %inner.loop.header, label %outer.loop.header
exit: ; preds = %inner.loop.body, %outer.loop.body, %outer.loop.header
ret i32 0
}