Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/GVN/pr46054-md-nonlocaldefcache-cleanup.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

82 lines
2.4 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=gvn -S %s | FileCheck %s
; Test for PR46054. Make sure we correctly invalidate MemoryDependenceAnalysis,
; after removing a nonlocaldef.
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @test_double(ptr %data) {
; CHECK-LABEL: @test_double(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[LUC:%.*]] = tail call noalias nonnull ptr @data()
; CHECK-NEXT: store i64 1, ptr [[LUC]], align 8, !invariant.group !0
; CHECK-NEXT: call void @fn(i64 1)
; CHECK-NEXT: br i1 true, label [[A:%.*]], label [[ENTRY_B_CRIT_EDGE:%.*]]
; CHECK: entry.B_crit_edge:
; CHECK-NEXT: br label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: br label [[B]]
; CHECK: B:
; CHECK-NEXT: call void @fn(i64 1)
; CHECK-NEXT: ret void
;
entry:
%luc = tail call noalias nonnull ptr @data()
store i64 1, ptr %luc, !invariant.group !0
%QQ = load i64, ptr %luc, !invariant.group !0
call void @fn(i64 %QQ)
br i1 true, label %A, label %B
A: ; preds = %loop
br label %B
B: ; preds = %A, %loop
%QQ.1 = load i64, ptr %luc, !invariant.group !0
call void @fn(i64 %QQ.1)
ret void
}
declare void @fn(i64)
declare noalias ptr @data()
define void @test_double_ptr(ptr %data) {
; CHECK-LABEL: @test_double_ptr(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[LUC:%.*]] = tail call noalias nonnull ptr @data.ptr()
; CHECK-NEXT: store ptr null, ptr [[LUC]], align 8, !invariant.group !0
; CHECK-NEXT: call void @fn.ptr(ptr null)
; CHECK-NEXT: br i1 true, label [[A:%.*]], label [[ENTRY_B_CRIT_EDGE:%.*]]
; CHECK: entry.B_crit_edge:
; CHECK-NEXT: br label [[B:%.*]]
; CHECK: A:
; CHECK-NEXT: br label [[B]]
; CHECK: B:
; CHECK-NEXT: call void @fn.ptr(ptr null)
; CHECK-NEXT: ret void
;
entry:
%luc = tail call noalias nonnull ptr @data.ptr()
store ptr null, ptr %luc, !invariant.group !0
%QQ = load ptr, ptr %luc, !invariant.group !0
call void @fn.ptr(ptr %QQ)
br i1 true, label %A, label %B
A: ; preds = %loop
br label %B
B: ; preds = %A, %loop
%QQ.1 = load ptr, ptr %luc, !invariant.group !0
call void @fn.ptr(ptr %QQ.1)
ret void
}
declare void @fn.ptr(ptr)
declare noalias ptr @data.ptr()
!0 = distinct !{}