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

95 lines
3.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
define i32 @test_loop_varying_bound_add_rec() {
; CHECK-LABEL: define i32 @test_loop_varying_bound_add_rec() {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_HEADER:%.*]]
; CHECK: for.header:
; CHECK-NEXT: [[IND1:%.*]] = phi i64 [ [[IND1_I:%.*]], [[FOR_LATCH:%.*]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[IND2:%.*]] = phi i64 [ [[IND2_I:%.*]], [[FOR_LATCH]] ], [ 5, [[ENTRY]] ]
; CHECK-NEXT: [[REM:%.*]] = srem i64 [[IND2]], 4
; CHECK-NEXT: [[CMP6:%.*]] = icmp eq i64 [[IND1]], [[REM]]
; CHECK-NEXT: br i1 [[CMP6]], label [[EXIT1:%.*]], label [[FOR_LATCH]]
; CHECK: for.latch:
; CHECK-NEXT: [[IND2_I]] = add i64 [[IND2]], 1
; CHECK-NEXT: [[IND1_I]] = add i64 [[IND1]], 1
; CHECK-NEXT: [[COND:%.*]] = icmp eq i64 [[IND1_I]], 8
; CHECK-NEXT: br i1 [[COND]], label [[EXIT2:%.*]], label [[FOR_HEADER]]
; CHECK: exit2:
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[REM]], 0
; CHECK-NEXT: [[RET:%.*]] = zext i1 [[CMP]] to i32
; CHECK-NEXT: ret i32 [[RET]]
; CHECK: exit1:
; CHECK-NEXT: ret i32 0
;
entry:
br label %for.header
for.header:
%ind1 = phi i64 [ %ind1.i, %for.latch ], [ 0, %entry ]
%ind2 = phi i64 [ %ind2.i, %for.latch ], [ 5, %entry ]
%rem = srem i64 %ind2, 4
%cmp6 = icmp eq i64 %ind1, %rem
br i1 %cmp6, label %exit1, label %for.latch
for.latch:
%ind2.i = add i64 %ind2, 1
%ind1.i = add i64 %ind1, 1
%cond = icmp eq i64 %ind1.i, 8
br i1 %cond, label %exit2, label %for.header
exit2:
%cmp = icmp eq i64 %rem, 0
%ret = zext i1 %cmp to i32
ret i32 %ret
exit1:
ret i32 0
}
declare i64 @callee()
define i32 @test_loop_varying_bound_call() {
; CHECK-LABEL: define i32 @test_loop_varying_bound_call() {
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[FOR_HEADER:%.*]]
; CHECK: for.header:
; CHECK-NEXT: [[IND1:%.*]] = phi i64 [ [[IND1_I:%.*]], [[FOR_LATCH:%.*]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[VAL:%.*]] = call i64 @callee()
; CHECK-NEXT: [[CMP6:%.*]] = icmp eq i64 [[IND1]], [[VAL]]
; CHECK-NEXT: br i1 [[CMP6]], label [[EXIT1:%.*]], label [[FOR_LATCH]]
; CHECK: for.latch:
; CHECK-NEXT: [[IND1_I]] = add i64 [[IND1]], 1
; CHECK-NEXT: [[COND:%.*]] = icmp eq i64 [[IND1_I]], 8
; CHECK-NEXT: br i1 [[COND]], label [[EXIT2:%.*]], label [[FOR_HEADER]]
; CHECK: exit2:
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[VAL]], 0
; CHECK-NEXT: [[RET:%.*]] = zext i1 [[CMP]] to i32
; CHECK-NEXT: ret i32 [[RET]]
; CHECK: exit1:
; CHECK-NEXT: ret i32 0
;
entry:
br label %for.header
for.header:
%ind1 = phi i64 [ %ind1.i, %for.latch ], [ 0, %entry ]
%val = call i64 @callee()
%cmp6 = icmp eq i64 %ind1, %val
br i1 %cmp6, label %exit1, label %for.latch
for.latch:
%ind1.i = add i64 %ind1, 1
%cond = icmp eq i64 %ind1.i, 8
br i1 %cond, label %exit2, label %for.header
exit2:
%cmp = icmp eq i64 %val, 0
%ret = zext i1 %cmp to i32
ret i32 %ret
exit1:
ret i32 0
}