Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-arrays.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

247 lines
10 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
define void @pointer.to.array.test.ult.true.due.to.first.dimension(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.ult.true.due.to.first.dimension(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 9, i64 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 5, i64 0
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 9, i64 3
%c.1 = icmp ule ptr %add.ptr.i, %high
br i1 %c.1, label %if.then, label %if.end
if.then: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 5, i64 0
%c.0 = icmp ult ptr %start.0, %high
call void @use(i1 %c.0)
ret void
if.end: ; preds = %entry
ret void
}
define void @pointer.to.array.test.ult.unknown.due.to.first.dimension(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.ult.unknown.due.to.first.dimension(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 5, i64 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 10, i64 0
; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_0]])
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 5, i64 3
%c.1 = icmp ule ptr %add.ptr.i, %high
br i1 %c.1, label %if.then, label %if.end
if.then: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 10, i64 0
%c.0 = icmp ult ptr %start.0, %high
call void @use(i1 %c.0)
ret void
if.end: ; preds = %entry
ret void
}
define void @pointer.to.array.test.ult.true.due.to.second.dimension(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.ult.true.due.to.second.dimension(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 5, i64 1
; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 5, i64 0
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 5, i64 1
%c.1 = icmp ule ptr %add.ptr.i, %high
br i1 %c.1, label %if.then, label %if.end
if.then: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 5, i64 0
%c.0 = icmp ult ptr %start.0, %high
call void @use(i1 %c.0)
ret void
if.end: ; preds = %entry
ret void
}
define void @pointer.to.array.test.ult.unknown.to.second.dimension(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.ult.unknown.to.second.dimension(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 5, i64 0
; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 5, i64 1
; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_0]])
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 5, i64 0
%c.1 = icmp ule ptr %add.ptr.i, %high
br i1 %c.1, label %if.then, label %if.end
if.then: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 5, i64 1
%c.0 = icmp ult ptr %start.0, %high
call void @use(i1 %c.0)
ret void
if.end: ; preds = %entry
ret void
}
define void @pointer.to.array.test.not.uge.ult(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.not.uge.ult(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 1, i64 3
; CHECK-NEXT: [[C_1:%.*]] = icmp uge ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 10, i64 0
; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_0]])
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 1, i64 3
%c.1 = icmp uge ptr %add.ptr.i, %high
br i1 %c.1, label %if.then, label %if.end
if.then: ; preds = %entry
ret void
if.end: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 10, i64 0
%c.0 = icmp ult ptr %start.0, %high
call void @use(i1 %c.0)
ret void
}
define void @pointer.to.array.test.not.uge.ule(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.not.uge.ule(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 1, i64 3
; CHECK-NEXT: [[C:%.*]] = icmp uge ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 10, i64 0
; CHECK-NEXT: [[C_0:%.*]] = icmp ule ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_0]])
; CHECK-NEXT: [[START_1:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 2, i64 1
; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_1]])
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 1, i64 3
%c = icmp uge ptr %add.ptr.i, %high
br i1 %c, label %if.then, label %if.end
if.then: ; preds = %entry
ret void
if.end: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 10, i64 0
%c.0 = icmp ule ptr %start.0, %high
call void @use(i1 %c.0)
%start.1 = getelementptr inbounds [10 x i8], ptr %start, i64 2, i64 1
%c.1 = icmp ule ptr %start.1, %high
call void @use(i1 %c.1)
ret void
}
define void @pointer.to.array.test.not.uge.ugt(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.not.uge.ugt(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 1, i64 3
; CHECK-NEXT: [[C:%.*]] = icmp uge ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 3, i64 0
; CHECK-NEXT: [[C_0:%.*]] = icmp ugt ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_0]])
; CHECK-NEXT: [[START_1:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 3, i64 1
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt ptr [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_1]])
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 1, i64 3
%c = icmp uge ptr %add.ptr.i, %high
br i1 %c, label %if.then, label %if.end
if.then: ; preds = %entry
ret void
if.end: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 3, i64 0
%c.0 = icmp ugt ptr %start.0, %high
call void @use(i1 %c.0)
%start.1 = getelementptr inbounds [10 x i8], ptr %start, i64 3, i64 1
%c.1 = icmp ugt ptr %start.1, %high
call void @use(i1 %c.1)
ret void
}
define void @pointer.to.array.test.not.uge.uge(ptr %start, ptr %high) {
; CHECK-LABEL: @pointer.to.array.test.not.uge.uge(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds [10 x i8], ptr [[START:%.*]], i64 1, i64 3
; CHECK-NEXT: [[C_1:%.*]] = icmp uge ptr [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 3, i64 0
; CHECK-NEXT: [[C_0:%.*]] = icmp uge ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_0]])
; CHECK-NEXT: ret void
;
entry:
%add.ptr.i = getelementptr inbounds [10 x i8], ptr %start, i64 1, i64 3
%c.1 = icmp uge ptr %add.ptr.i, %high
br i1 %c.1, label %if.then, label %if.end
if.then: ; preds = %entry
ret void
if.end: ; preds = %entry
%start.0 = getelementptr inbounds [10 x i8], ptr %start, i64 3, i64 0
%c.0 = icmp uge ptr %start.0, %high
call void @use(i1 %c.0)
ret void
}
declare void @use(i1)