Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/NewGVN/metadata-simplify.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

161 lines
4.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; The tests in this file check that we do not simplify based on metadata that is
; not available on all code paths.
; RUN: opt < %s -S -passes=newgvn | FileCheck %s
define i1 @test1(ptr %arg, i1 %arg2) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[LOAD1:%.*]] = load ptr, ptr [[ARG:%.*]], align 8, !nonnull [[META0:![0-9]+]]
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq ptr [[LOAD1]], null
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
; CHECK-NEXT: [[LOAD2:%.*]] = load ptr, ptr [[ARG]], align 8
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq ptr [[LOAD2]], null
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
%load1 = load ptr, ptr %arg, !nonnull !0
%cmp1 = icmp eq ptr %load1, null
ret i1 %cmp1
bb2:
%load2 = load ptr, ptr %arg
%cmp2 = icmp eq ptr %load2, null
ret i1 %cmp2
}
define i1 @test2(ptr %arg, i1 %arg2) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[LOAD1:%.*]] = load ptr, ptr [[ARG:%.*]], align 8
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq ptr [[LOAD1]], null
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
; CHECK-NEXT: [[LOAD2:%.*]] = load ptr, ptr [[ARG]], align 8, !nonnull [[META0]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp eq ptr [[LOAD2]], null
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
%load1 = load ptr, ptr %arg
%cmp1 = icmp eq ptr %load1, null
ret i1 %cmp1
bb2:
%load2 = load ptr, ptr %arg, !nonnull !0
%cmp2 = icmp eq ptr %load2, null
ret i1 %cmp2
}
define i1 @test3(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test3(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]], align 4, !range [[RNG1:![0-9]+]]
; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]], align 4
; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
%load1 = load i32, ptr %ptr, !range !1
%cmp1 = icmp ne i32 %load1, 999
ret i1 %cmp1
bb2:
%load2 = load i32, ptr %ptr
%cmp2 = icmp ne i32 %load2, 999
ret i1 %cmp2
}
define i1 @test4(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test4(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]], align 4
; CHECK-NEXT: [[CMP1:%.*]] = icmp ne i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]], align 4, !range [[RNG1]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp ne i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
%load1 = load i32, ptr %ptr
%cmp1 = icmp ne i32 %load1, 999
ret i1 %cmp1
bb2:
%load2 = load i32, ptr %ptr, !range !1
%cmp2 = icmp ne i32 %load2, 999
ret i1 %cmp2
}
define i1 @test5(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]], align 4, !range [[RNG1]]
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]], align 4
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
%load1 = load i32, ptr %ptr, !range !1
%cmp1 = icmp slt i32 %load1, 999
ret i1 %cmp1
bb2:
%load2 = load i32, ptr %ptr
%cmp2 = icmp slt i32 %load2, 999
ret i1 %cmp2
}
define i1 @test6(ptr %ptr, i1 %arg2) {
; CHECK-LABEL: @test6(
; CHECK-NEXT: br i1 [[ARG2:%.*]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[PTR:%.*]], align 4
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[LOAD1]], 999
; CHECK-NEXT: ret i1 [[CMP1]]
; CHECK: bb2:
; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[PTR]], align 4, !range [[RNG1]]
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[LOAD2]], 999
; CHECK-NEXT: ret i1 [[CMP2]]
;
br i1 %arg2, label %bb1, label %bb2
bb1:
%load1 = load i32, ptr %ptr
%cmp1 = icmp slt i32 %load1, 999
ret i1 %cmp1
bb2:
%load2 = load i32, ptr %ptr, !range !1
%cmp2 = icmp slt i32 %load2, 999
ret i1 %cmp2
}
!0 = !{}
!1 = !{ i32 10, i32 20 }