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

68 lines
2.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=loop-predication < %s 2>&1 | FileCheck %s
declare void @llvm.experimental.deoptimize.isVoid(...)
define void @test_01(i1 %cond) {
; CHECK-LABEL: @test_01(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[INST:%.*]] = call i1 @llvm.experimental.widenable.condition()
; CHECK-NEXT: [[TMP0:%.*]] = freeze i1 true
; CHECK-NEXT: [[TMP1:%.*]] = and i1 [[TMP0]], [[INST]]
; CHECK-NEXT: br label [[LOOP:%.*]]
; CHECK: unreached:
; CHECK-NEXT: unreachable
; CHECK: loop:
; CHECK-NEXT: [[INST3:%.*]] = phi i32 [ 0, [[BB:%.*]] ], [ [[INST4:%.*]], [[BACKEDGE:%.*]] ]
; CHECK-NEXT: [[INST4]] = add nsw i32 [[INST3]], 1
; CHECK-NEXT: br i1 [[COND:%.*]], label [[BACKEDGE]], label [[GUARD_BLOCK:%.*]]
; CHECK: normal_ret:
; CHECK-NEXT: ret void
; CHECK: backedge:
; CHECK-NEXT: [[ASSUME_COND:%.*]] = phi i1 [ [[INST9:%.*]], [[GUARD_BLOCK]] ], [ true, [[LOOP]] ]
; CHECK-NEXT: call void @llvm.assume(i1 [[ASSUME_COND]])
; CHECK-NEXT: [[INST7:%.*]] = icmp sgt i32 [[INST3]], 137
; CHECK-NEXT: br i1 [[INST7]], label [[UNREACHED:%.*]], label [[LOOP]]
; CHECK: guard_block:
; CHECK-NEXT: [[INST9]] = icmp ult i32 [[INST4]], 10000
; CHECK-NEXT: br i1 [[TMP1]], label [[BACKEDGE]], label [[DEOPT:%.*]]
; CHECK: deopt:
; CHECK-NEXT: call void (...) @llvm.experimental.deoptimize.isVoid(i32 13) [ "deopt"() ]
; CHECK-NEXT: ret void
; CHECK: done:
; CHECK-NEXT: ret void
;
bb:
%inst = call i1 @llvm.experimental.widenable.condition()
br label %loop
unreached: ; preds = %backedge
unreachable
loop: ; preds = %backedge, %bb
%inst3 = phi i32 [ 0, %bb ], [ %inst4, %backedge ]
%inst4 = add nsw i32 %inst3, 1
br i1 %cond, label %backedge, label %guard_block
normal_ret: ; preds = %loop
ret void
backedge: ; preds = %guard_block, %loop
%inst7 = icmp sgt i32 %inst3, 137
br i1 %inst7, label %unreached, label %loop
guard_block: ; preds = %loop, %loop
%inst9 = icmp ult i32 %inst4, 10000
%inst10 = and i1 %inst9, %inst
br i1 %inst10, label %backedge, label %deopt
deopt: ; preds = %guard_block
call void (...) @llvm.experimental.deoptimize.isVoid(i32 13) [ "deopt"() ]
ret void
done: ; preds = %loop
ret void
}
declare i1 @llvm.experimental.widenable.condition()