Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/SCCP/dangling-block-address.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

89 lines
2.7 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=internalize,ipsccp %s | FileCheck %s
; PR5569
; If BasicBlocks are unreachable, IPSCCP should convert them to unreachable.
; Unless they have their address taken, delete them. If they do have their
; address taken, let other passes replace these "dead" blockaddresses with some
; other Constant.
; CHECK: @bar.l = internal constant [2 x ptr] [ptr blockaddress(@bar, %lab0), ptr blockaddress(@bar, %end)]
@code = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 ; <ptr> [#uses=0]
@bar.l = internal constant [2 x ptr] [ptr blockaddress(@bar, %lab0), ptr blockaddress(@bar, %end)] ; <ptr> [#uses=1]
define void @foo(i32 %x) nounwind readnone {
; CHECK-LABEL: @foo(
; CHECK-NEXT: entry:
; CHECK-NEXT: unreachable
;
entry:
%b = alloca i32, align 4 ; <ptr> [#uses=1]
store volatile i32 -1, ptr %b
ret void
}
define void @bar(ptr nocapture %pc) nounwind readonly {
; CHECK-LABEL: @bar(
; CHECK-NEXT: entry:
; CHECK-NEXT: unreachable
; CHECK: lab0:
; CHECK-NEXT: unreachable
; CHECK: end:
; CHECK-NEXT: unreachable
;
entry:
br label %indirectgoto
lab0: ; preds = %indirectgoto
%indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
br label %indirectgoto
end: ; preds = %indirectgoto
ret void
indirectgoto: ; preds = %lab0, %entry
%indvar = phi i32 [ %indvar.next, %lab0 ], [ 0, %entry ] ; <i32> [#uses=2]
%pc.addr.0 = getelementptr i32, ptr %pc, i32 %indvar ; <ptr> [#uses=1]
%tmp1.pn = load i32, ptr %pc.addr.0 ; <i32> [#uses=1]
%indirect.goto.dest.in = getelementptr inbounds [2 x ptr], ptr @bar.l, i32 0, i32 %tmp1.pn ; <ptr> [#uses=1]
%indirect.goto.dest = load ptr, ptr %indirect.goto.dest.in ; <ptr> [#uses=1]
indirectbr ptr %indirect.goto.dest, [label %lab0, label %end]
}
define i32 @main() nounwind readnone {
; CHECK-LABEL: @main(
; CHECK-NEXT: entry:
; CHECK-NEXT: unreachable
;
entry:
ret i32 0
}
; https://github.com/llvm/llvm-project/issues/54238
; https://github.com/llvm/llvm-project/issues/54251
; https://github.com/llvm/llvm-project/issues/54328
define i32 @test1() {
; CHECK-LABEL: @test1(
; CHECK-NEXT: unreachable
; CHECK: redirected:
; CHECK-NEXT: unreachable
;
%1 = bitcast ptr blockaddress(@test1, %redirected) to ptr
call void @set_return_addr(ptr %1)
ret i32 0
redirected:
ret i32 0
}
define internal void @set_return_addr(ptr %addr) {
; CHECK-LABEL: @set_return_addr(
; CHECK-NEXT: unreachable
;
%addr.addr = alloca ptr, i32 0, align 8
store ptr %addr, ptr %addr.addr, align 8
ret void
}