Files
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

85 lines
2.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=jump-threading -S < %s | FileCheck %s
@x = global i32 0
@y = global i32 0
declare void @f()
declare void @g()
define i32 @pre(i1 %cond, i32 %n) {
; CHECK-LABEL: @pre(
; CHECK-NEXT: br i1 [[COND:%.*]], label [[C_THREAD:%.*]], label [[C:%.*]]
; CHECK: C.thread:
; CHECK-NEXT: store i32 0, ptr @x, align 4
; CHECK-NEXT: br label [[YES:%.*]]
; CHECK: C:
; CHECK-NEXT: [[A_PR:%.*]] = load i32, ptr @y, align 4
; CHECK-NEXT: [[COND2:%.*]] = icmp eq i32 [[A_PR]], 0
; CHECK-NEXT: br i1 [[COND2]], label [[YES]], label [[NO:%.*]]
; CHECK: YES:
; CHECK-NEXT: [[A4:%.*]] = phi i32 [ 0, [[C_THREAD]] ], [ [[A_PR]], [[C]] ]
; CHECK-NEXT: call void @f()
; CHECK-NEXT: ret i32 [[A4]]
; CHECK: NO:
; CHECK-NEXT: call void @g()
; CHECK-NEXT: ret i32 1
;
br i1 %cond, label %A, label %B
A:
store i32 0, ptr @x
br label %C
B:
br label %C
C:
%ptr = phi ptr [@x, %A], [@y, %B]
%a = load i32, ptr %ptr
%cond2 = icmp eq i32 %a, 0
br i1 %cond2, label %YES, label %NO
YES:
call void @f()
ret i32 %a
NO:
call void @g()
ret i32 1
}
define i32 @pre_freeze(i1 %cond, i32 %n) {
; CHECK-LABEL: @pre_freeze(
; CHECK-NEXT: br i1 [[COND:%.*]], label [[C_THREAD:%.*]], label [[C:%.*]]
; CHECK: C.thread:
; CHECK-NEXT: store i32 0, ptr @x, align 4
; CHECK-NEXT: br label [[YES:%.*]]
; CHECK: C:
; CHECK-NEXT: [[A_PR:%.*]] = load i32, ptr @y, align 4
; CHECK-NEXT: [[COND2:%.*]] = icmp eq i32 [[A_PR]], 0
; CHECK-NEXT: [[COND2_FR:%.*]] = freeze i1 [[COND2]]
; CHECK-NEXT: br i1 [[COND2_FR]], label [[YES]], label [[NO:%.*]]
; CHECK: YES:
; CHECK-NEXT: [[A5:%.*]] = phi i32 [ 0, [[C_THREAD]] ], [ [[A_PR]], [[C]] ]
; CHECK-NEXT: call void @f()
; CHECK-NEXT: ret i32 [[A5]]
; CHECK: NO:
; CHECK-NEXT: call void @g()
; CHECK-NEXT: ret i32 1
;
br i1 %cond, label %A, label %B
A:
store i32 0, ptr @x
br label %C
B:
br label %C
C:
%ptr = phi ptr [@x, %A], [@y, %B]
%a = load i32, ptr %ptr
%cond2 = icmp eq i32 %a, 0
%cond2.fr = freeze i1 %cond2
br i1 %cond2.fr, label %YES, label %NO
YES:
call void @f()
ret i32 %a
NO:
call void @g()
ret i32 1
}