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
2.6 KiB
LLVM
96 lines
2.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
|
|
|
|
define i1 @test_conds_single_use_in_different_blocks(i8 %x) {
|
|
; CHECK-LABEL: @test_conds_single_use_in_different_blocks(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[X:%.*]], 10
|
|
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[X]], 5
|
|
; CHECK-NEXT: br i1 [[C_1]], label [[THEN:%.*]], label [[ELSE:%.*]]
|
|
; CHECK: then:
|
|
; CHECK-NEXT: ret i1 true
|
|
; CHECK: else:
|
|
; CHECK-NEXT: ret i1 [[C_2]]
|
|
;
|
|
entry:
|
|
%c.1 = icmp ugt i8 %x, 10
|
|
%t.1 = icmp ugt i8 %x, 5
|
|
%c.2 = icmp ugt i8 %x, 5
|
|
br i1 %c.1, label %then, label %else
|
|
|
|
then:
|
|
ret i1 %t.1
|
|
|
|
else:
|
|
ret i1 %c.2
|
|
}
|
|
|
|
|
|
define i1 @test_conds_single_use_in_different_blocks_2(i8 %x, i8 %y) {
|
|
; CHECK-LABEL: @test_conds_single_use_in_different_blocks_2(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[X:%.*]], 10
|
|
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[Y:%.*]], [[X]]
|
|
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i8 [[Y]], 5
|
|
; CHECK-NEXT: br i1 [[C_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
|
|
; CHECK: then.1:
|
|
; CHECK-NEXT: br i1 [[C_2]], label [[THEN_2:%.*]], label [[ELSE]]
|
|
; CHECK: then.2:
|
|
; CHECK-NEXT: ret i1 true
|
|
; CHECK: else:
|
|
; CHECK-NEXT: ret i1 [[C_3]]
|
|
;
|
|
entry:
|
|
%c.1 = icmp ugt i8 %x, 10
|
|
%t.1 = icmp ugt i8 %y, 5
|
|
%c.2 = icmp ugt i8 %y, %x
|
|
%c.3 = icmp ugt i8 %y, 5
|
|
br i1 %c.1, label %then.1, label %else
|
|
|
|
then.1:
|
|
br i1 %c.2, label %then.2, label %else
|
|
|
|
then.2:
|
|
ret i1 %t.1
|
|
|
|
else:
|
|
ret i1 %c.3
|
|
}
|
|
|
|
declare void @llvm.assume(i1)
|
|
|
|
; Only the use of %t.1 in %then.2 could be simplified, but not the one in
|
|
; %entry.
|
|
define i1 @test_conds_multiple_uses_in_different_blocks_2(i8 %x, i8 %y) {
|
|
; CHECK-LABEL: @test_conds_multiple_uses_in_different_blocks_2(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[X:%.*]], 10
|
|
; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[Y:%.*]], 5
|
|
; CHECK-NEXT: call void @llvm.assume(i1 [[T_1]])
|
|
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[Y]], [[X]]
|
|
; CHECK-NEXT: br i1 [[C_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
|
|
; CHECK: then.1:
|
|
; CHECK-NEXT: br i1 [[C_2]], label [[THEN_2:%.*]], label [[ELSE]]
|
|
; CHECK: then.2:
|
|
; CHECK-NEXT: ret i1 true
|
|
; CHECK: else:
|
|
; CHECK-NEXT: ret i1 true
|
|
;
|
|
entry:
|
|
%c.1 = icmp ugt i8 %x, 10
|
|
%t.1 = icmp ugt i8 %y, 5
|
|
call void @llvm.assume(i1 %t.1)
|
|
%c.2 = icmp ugt i8 %y, %x
|
|
%c.3 = icmp ugt i8 %y, 5
|
|
br i1 %c.1, label %then.1, label %else
|
|
|
|
then.1:
|
|
br i1 %c.2, label %then.2, label %else
|
|
|
|
then.2:
|
|
ret i1 %t.1
|
|
|
|
else:
|
|
ret i1 %c.3
|
|
}
|