Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/GVNHoist/pr35222-hoist-load.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

71 lines
1.6 KiB
LLVM

; RUN: opt -S -passes=gvn-hoist < %s | FileCheck %s
; CHECK-LABEL: build_tree
; CHECK: load
; CHECK: load
; Check that the load is not hoisted because the call can potentially
; modify the global
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
@heap = external global i32, align 4
define i32 @build_tree() unnamed_addr {
entry:
br label %do.body
do.body: ; preds = %do.body, %entry
%tmp9 = load i32, ptr @heap, align 4
%cmp = call i1 @pqdownheap(i32 %tmp9)
br i1 %cmp, label %do.body, label %do.end
do.end: ; preds = %do.body
%tmp20 = load i32, ptr @heap, align 4
ret i32 %tmp20
}
declare i1 @pqdownheap(i32)
@i = external hidden unnamed_addr global i32, align 4
@j = external hidden unnamed_addr global [573 x i32], align 4
@v = external global i1
; CHECK-LABEL: test
; CHECK-LABEL: do.end
; CHECK: load
; Check that the load is not hoisted because the call can potentially
; modify the global
define i32 @test() {
entry:
br label %for.cond
for.cond:
%a3 = load volatile i1, ptr @v
br i1 %a3, label %for.body, label %while.end
for.body:
br label %if.then
if.then:
%tmp4 = load i32, ptr @i, align 4
br label %for.cond
while.end:
br label %do.body
do.body:
%tmp9 = load i32, ptr getelementptr inbounds ([573 x i32], ptr @j,
i32 0, i32 1), align 4
%tmp10 = load i32, ptr @i, align 4
call void @fn()
%a1 = load volatile i1, ptr @v
br i1 %a1, label %do.body, label %do.end
do.end:
%tmp20 = load i32, ptr getelementptr inbounds ([573 x i32], ptr @j,
i32 0, i32 1), align 4
ret i32 %tmp20
}
declare void @fn()