Files
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

104 lines
4.1 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=loop-unroll -unroll-count=4 < %s | FileCheck %s
define void @test_inside(ptr %addr1, ptr %addr2) {
; CHECK-LABEL: @test_inside(
; CHECK-NEXT: start:
; CHECK-NEXT: br label [[BODY:%.*]]
; CHECK: body:
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
; CHECK-NEXT: [[X:%.*]] = load i32, ptr [[ADDR1:%.*]], align 4, !alias.scope !0
; CHECK-NEXT: store i32 [[X]], ptr [[ADDR2:%.*]], align 4, !noalias !0
; CHECK-NEXT: [[ADDR1I_1:%.*]] = getelementptr inbounds i32, ptr [[ADDR1]], i32 1
; CHECK-NEXT: [[ADDR2I_1:%.*]] = getelementptr inbounds i32, ptr [[ADDR2]], i32 1
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !3)
; CHECK-NEXT: [[X_1:%.*]] = load i32, ptr [[ADDR1I_1]], align 4, !alias.scope !3
; CHECK-NEXT: store i32 [[X_1]], ptr [[ADDR2I_1]], align 4, !noalias !3
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !5)
; CHECK-NEXT: [[X_2:%.*]] = load i32, ptr [[ADDR1]], align 4, !alias.scope !5
; CHECK-NEXT: store i32 [[X_2]], ptr [[ADDR2]], align 4, !noalias !5
; CHECK-NEXT: [[ADDR1I_3:%.*]] = getelementptr inbounds i32, ptr [[ADDR1]], i32 1
; CHECK-NEXT: [[ADDR2I_3:%.*]] = getelementptr inbounds i32, ptr [[ADDR2]], i32 1
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !7)
; CHECK-NEXT: [[X_3:%.*]] = load i32, ptr [[ADDR1I_3]], align 4, !alias.scope !7
; CHECK-NEXT: store i32 [[X_3]], ptr [[ADDR2I_3]], align 4, !noalias !7
; CHECK-NEXT: ret void
;
start:
br label %body
body:
%i = phi i32 [ 0, %start ], [ %i2, %body ]
%j = and i32 %i, 1
%addr1i = getelementptr inbounds i32, ptr %addr1, i32 %j
%addr2i = getelementptr inbounds i32, ptr %addr2, i32 %j
call void @llvm.experimental.noalias.scope.decl(metadata !2)
%x = load i32, ptr %addr1i, !alias.scope !2
store i32 %x, ptr %addr2i, !noalias !2
%i2 = add i32 %i, 1
%cmp = icmp slt i32 %i2, 4
br i1 %cmp, label %body, label %end
end:
ret void
}
define void @test_outside(ptr %addr1, ptr %addr2) {
; CHECK-LABEL: @test_outside(
; CHECK-NEXT: start:
; CHECK-NEXT: call void @llvm.experimental.noalias.scope.decl(metadata !0)
; CHECK-NEXT: br label [[BODY:%.*]]
; CHECK: body:
; CHECK-NEXT: [[X:%.*]] = load i32, ptr [[ADDR1:%.*]], align 4, !alias.scope !0
; CHECK-NEXT: store i32 [[X]], ptr [[ADDR2:%.*]], align 4, !noalias !0
; CHECK-NEXT: [[ADDR1I_1:%.*]] = getelementptr inbounds i32, ptr [[ADDR1]], i32 1
; CHECK-NEXT: [[ADDR2I_1:%.*]] = getelementptr inbounds i32, ptr [[ADDR2]], i32 1
; CHECK-NEXT: [[X_1:%.*]] = load i32, ptr [[ADDR1I_1]], align 4, !alias.scope !0
; CHECK-NEXT: store i32 [[X_1]], ptr [[ADDR2I_1]], align 4, !noalias !0
; CHECK-NEXT: [[X_2:%.*]] = load i32, ptr [[ADDR1]], align 4, !alias.scope !0
; CHECK-NEXT: store i32 [[X_2]], ptr [[ADDR2]], align 4, !noalias !0
; CHECK-NEXT: [[ADDR1I_3:%.*]] = getelementptr inbounds i32, ptr [[ADDR1]], i32 1
; CHECK-NEXT: [[ADDR2I_3:%.*]] = getelementptr inbounds i32, ptr [[ADDR2]], i32 1
; CHECK-NEXT: [[X_3:%.*]] = load i32, ptr [[ADDR1I_3]], align 4, !alias.scope !0
; CHECK-NEXT: store i32 [[X_3]], ptr [[ADDR2I_3]], align 4, !noalias !0
; CHECK-NEXT: ret void
;
start:
call void @llvm.experimental.noalias.scope.decl(metadata !2)
br label %body
body:
%i = phi i32 [ 0, %start ], [ %i2, %body ]
%j = and i32 %i, 1
%addr1i = getelementptr inbounds i32, ptr %addr1, i32 %j
%addr2i = getelementptr inbounds i32, ptr %addr2, i32 %j
%x = load i32, ptr %addr1i, !alias.scope !2
store i32 %x, ptr %addr2i, !noalias !2
%i2 = add i32 %i, 1
%cmp = icmp slt i32 %i2, 4
br i1 %cmp, label %body, label %end
end:
ret void
}
declare void @llvm.experimental.noalias.scope.decl(metadata)
!0 = distinct !{!0}
!1 = distinct !{!1, !0}
!2 = !{!1}
; CHECK: !0 = !{!1}
; CHECK: !1 = distinct !{!1, !2}
; CHECK: !2 = distinct !{!2}
; CHECK: !3 = !{!4}
; CHECK: !4 = distinct !{!4, !2, !"It1"}
; CHECK: !5 = !{!6}
; CHECK: !6 = distinct !{!6, !2, !"It2"}
; CHECK: !7 = !{!8}
; CHECK: !8 = distinct !{!8, !2, !"It3"}