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
111 lines
3.1 KiB
LLVM
111 lines
3.1 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=simplifycfg,adce -simplifycfg-require-and-preserve-domtree=1 -keep-loops="false" -S | FileCheck %s
|
|
|
|
declare void @f1()
|
|
|
|
declare void @f2()
|
|
|
|
declare void @f3()
|
|
|
|
declare void @f4()
|
|
|
|
define i32 @test1(i32 %X, i1 %D) {
|
|
; CHECK-LABEL: @test1(
|
|
; CHECK-NEXT: E:
|
|
; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[X:%.*]], 0
|
|
; CHECK-NEXT: br i1 [[C]], label [[B:%.*]], label [[F:%.*]]
|
|
; CHECK: common.ret:
|
|
; CHECK-NEXT: [[COMMON_RET_OP:%.*]] = phi i32 [ 345, [[B]] ], [ 123, [[F]] ]
|
|
; CHECK-NEXT: ret i32 [[COMMON_RET_OP]]
|
|
; CHECK: B:
|
|
; CHECK-NEXT: call void @f2()
|
|
; CHECK-NEXT: br label [[COMMON_RET:%.*]]
|
|
; CHECK: F:
|
|
; CHECK-NEXT: call void @f3()
|
|
; CHECK-NEXT: br label [[COMMON_RET]]
|
|
;
|
|
E:
|
|
%C = icmp eq i32 %X, 0 ; <i1> [#uses=2]
|
|
br i1 %C, label %T, label %F
|
|
T: ; preds = %A, %E
|
|
br i1 %C, label %B, label %A
|
|
A: ; preds = %T
|
|
call void @f1( )
|
|
br i1 %D, label %T, label %F
|
|
B: ; preds = %T
|
|
call void @f2( )
|
|
ret i32 345
|
|
F: ; preds = %A, %E
|
|
call void @f3( )
|
|
ret i32 123
|
|
}
|
|
|
|
define i32 @test2(i32 %X, i1 %D) {
|
|
; CHECK-LABEL: @test2(
|
|
; CHECK-NEXT: E:
|
|
; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[X:%.*]], 0
|
|
; CHECK-NEXT: br i1 [[C]], label [[B:%.*]], label [[F:%.*]]
|
|
; CHECK: common.ret:
|
|
; CHECK-NEXT: [[COMMON_RET_OP:%.*]] = phi i32 [ 345, [[B]] ], [ 123, [[F]] ]
|
|
; CHECK-NEXT: ret i32 [[COMMON_RET_OP]]
|
|
; CHECK: B:
|
|
; CHECK-NEXT: call void @f2()
|
|
; CHECK-NEXT: br label [[COMMON_RET:%.*]]
|
|
; CHECK: F:
|
|
; CHECK-NEXT: call void @f3()
|
|
; CHECK-NEXT: br label [[COMMON_RET]]
|
|
;
|
|
E:
|
|
%C = icmp eq i32 %X, 0 ; <i1> [#uses=2]
|
|
br i1 %C, label %T, label %F
|
|
T: ; preds = %A, %E
|
|
%P = phi i1 [ true, %E ], [ %C, %A ] ; <i1> [#uses=1]
|
|
br i1 %P, label %B, label %A
|
|
A: ; preds = %T
|
|
call void @f1( )
|
|
br i1 %D, label %T, label %F
|
|
B: ; preds = %T
|
|
call void @f2( )
|
|
ret i32 345
|
|
F: ; preds = %A, %E
|
|
call void @f3( )
|
|
ret i32 123
|
|
}
|
|
|
|
define i32 @test3(i32 %X, i1 %D, ptr %AP, ptr %BP) {
|
|
; CHECK-LABEL: @test3(
|
|
; CHECK-NEXT: E:
|
|
; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[X:%.*]], 0
|
|
; CHECK-NEXT: br i1 [[C]], label [[B_CRITEDGE:%.*]], label [[F:%.*]]
|
|
; CHECK: common.ret:
|
|
; CHECK-NEXT: [[COMMON_RET_OP:%.*]] = phi i32 [ 345, [[B_CRITEDGE]] ], [ 123, [[F]] ]
|
|
; CHECK-NEXT: ret i32 [[COMMON_RET_OP]]
|
|
; CHECK: B.critedge:
|
|
; CHECK-NEXT: call void @f3()
|
|
; CHECK-NEXT: [[XX_C:%.*]] = load i32, ptr [[AP:%.*]], align 4
|
|
; CHECK-NEXT: store i32 [[XX_C]], ptr [[BP:%.*]], align 4
|
|
; CHECK-NEXT: call void @f2()
|
|
; CHECK-NEXT: br label [[COMMON_RET:%.*]]
|
|
; CHECK: F:
|
|
; CHECK-NEXT: call void @f3()
|
|
; CHECK-NEXT: br label [[COMMON_RET]]
|
|
;
|
|
E:
|
|
%C = icmp eq i32 %X, 0 ; <i1> [#uses=2]
|
|
br i1 %C, label %T, label %F
|
|
T: ; preds = %A, %E
|
|
call void @f3( )
|
|
%XX = load i32, ptr %AP ; <i32> [#uses=1]
|
|
store i32 %XX, ptr %BP
|
|
br i1 %C, label %B, label %A
|
|
A: ; preds = %T
|
|
call void @f1( )
|
|
br i1 %D, label %T, label %F
|
|
B: ; preds = %T
|
|
call void @f2( )
|
|
ret i32 345
|
|
F: ; preds = %A, %E
|
|
call void @f3( )
|
|
ret i32 123
|
|
}
|