Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/GVN/PRE/pre-load-combine-metadata.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
2.7 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt < %s -passes=gvn -enable-load-pre -S | FileCheck %s --check-prefixes=CHECK,MDEP
; RUN: opt < %s -passes='gvn<memoryssa>' -enable-load-pre -S | FileCheck %s --check-prefixes=CHECK,MSSA
; Ensure AA metadata are combined properly while hoisting the load.
@g_bool = global i8 0, align 1
@g_long = global i64 0, align 8
define void @test_combine_metadata(i1 %c, i64 %arg) {
; CHECK-LABEL: define void @test_combine_metadata(
; CHECK-SAME: i1 [[C:%.*]], i64 [[ARG:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*]]:
; CHECK-NEXT: [[VAL:%.*]] = alloca i8, align 1
; CHECK-NEXT: br label %[[LOOP:.*]]
; CHECK: [[LOOP]]:
; CHECK-NEXT: [[PHI:%.*]] = phi ptr [ @g_long, %[[IF_THEN:.*]] ], [ [[VAL]], %[[ENTRY]] ]
; CHECK-NEXT: store i64 [[ARG]], ptr @g_long, align 8, !tbaa [[LONG_TBAA0:![0-9]+]]
; CHECK-NEXT: [[TRUNC:%.*]] = trunc i64 [[ARG]] to i8
; CHECK-NEXT: store i8 [[TRUNC]], ptr [[VAL]], align 1, !tbaa [[_BOOL_TBAA4:![0-9]+]]
; CHECK-NEXT: [[V1_PRE:%.*]] = load i8, ptr [[PHI]], align 1, !tbaa [[CHAR_TBAA6:![0-9]+]]
; CHECK-NEXT: br i1 [[C]], label %[[IF_THEN]], label %[[IF_ELSE:.*]]
; CHECK: [[IF_ELSE]]:
; CHECK-NEXT: store i8 [[V1_PRE]], ptr @g_bool, align 8, !tbaa [[LONG_TBAA0]]
; CHECK-NEXT: br label %[[IF_THEN]]
; CHECK: [[IF_THEN]]:
; CHECK-NEXT: store i8 [[V1_PRE]], ptr @g_bool, align 1
; CHECK-NEXT: br label %[[LOOP]]
;
entry:
%val = alloca i8, align 1
br label %loop
loop:
%phi = phi ptr [ @g_long, %if.then ], [ %val, %entry ]
store i64 %arg, ptr @g_long, align 8, !tbaa !3
%trunc = trunc i64 %arg to i8
store i8 %trunc, ptr %val, align 1, !tbaa !5
br i1 %c, label %if.then, label %if.else
if.else:
%v2 = load i8, ptr %phi, align 1, !tbaa !7
store i8 %v2, ptr @g_bool, align 8, !tbaa !3
br label %if.then
if.then:
%v1 = load i8, ptr %phi, align 1, !tbaa !5
store i8 %v1, ptr @g_bool, align 1
br label %loop
}
!0 = !{!"Simple C/C++ TBAA"}
!1 = !{!"omnipotent char", !0, i64 0}
!2 = !{!"long", !1, i64 0}
!3 = !{!2, !2, i64 0}
!4 = !{!"_Bool", !1, i64 0}
!5 = !{!4, !4, i64 0}
!7 = !{!1, !1, i64 0}
;.
; CHECK: [[LONG_TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}
; CHECK: [[META1]] = !{!"long", [[META2:![0-9]+]], i64 0}
; CHECK: [[META2]] = !{!"omnipotent char", [[META3:![0-9]+]], i64 0}
; CHECK: [[META3]] = !{!"Simple C/C++ TBAA"}
; CHECK: [[_BOOL_TBAA4]] = !{[[META5:![0-9]+]], [[META5]], i64 0}
; CHECK: [[META5]] = !{!"_Bool", [[META2]], i64 0}
; CHECK: [[CHAR_TBAA6]] = !{[[META2]], [[META2]], i64 0}
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; MDEP: {{.*}}
; MSSA: {{.*}}