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
111 lines
4.8 KiB
LLVM
111 lines
4.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
|
|
; RUN: opt -passes=loop-interchange -cache-line-size=64 -S < %s | FileCheck %s
|
|
|
|
; Test cases for PR43473.
|
|
|
|
; In the 2 test cases below, we have a LCSSA PHI in the inner loop exit, which
|
|
; is used in the outer loop latch. This is not supported.
|
|
|
|
define void @test1(i1 %arg) {
|
|
; CHECK-LABEL: define void @test1(
|
|
; CHECK-SAME: i1 [[ARG:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*]]:
|
|
; CHECK-NEXT: br label %[[OUTER_HEADER:.*]]
|
|
; CHECK: [[OUTER_HEADER]]:
|
|
; CHECK-NEXT: [[OUTER_IV:%.*]] = phi i64 [ undef, %[[ENTRY]] ], [ [[OUTER_IV_NEXT:%.*]], %[[OUTER_LATCH:.*]] ]
|
|
; CHECK-NEXT: [[IDX:%.*]] = getelementptr inbounds double, ptr undef, i64 [[OUTER_IV]]
|
|
; CHECK-NEXT: br label %[[INNER:.*]]
|
|
; CHECK: [[INNER]]:
|
|
; CHECK-NEXT: [[INNER_IV:%.*]] = phi i64 [ 0, %[[OUTER_HEADER]] ], [ [[INNER_IV_NEXT:%.*]], %[[INNER]] ]
|
|
; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[IDX]], align 8
|
|
; CHECK-NEXT: store double undef, ptr [[IDX]], align 8
|
|
; CHECK-NEXT: [[INNER_IV_NEXT]] = add nuw nsw i64 [[INNER_IV]], 1
|
|
; CHECK-NEXT: br i1 [[ARG]], label %[[INNER]], label %[[OUTER_LATCH]]
|
|
; CHECK: [[OUTER_LATCH]]:
|
|
; CHECK-NEXT: [[INC43_LCSSA_WIDE_US:%.*]] = phi i64 [ [[INNER_IV_NEXT]], %[[INNER]] ]
|
|
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[INC43_LCSSA_WIDE_US]] to i32
|
|
; CHECK-NEXT: [[OUTER_IV_NEXT]] = add nsw i64 [[OUTER_IV]], 1
|
|
; CHECK-NEXT: br i1 [[ARG]], label %[[OUTER_HEADER]], label %[[OUTER_EXIT:.*]]
|
|
; CHECK: [[OUTER_EXIT]]:
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
br label %outer.header
|
|
|
|
outer.header: ; preds = %for.cond26.for.end44_crit_edge.us, %entry
|
|
%outer.iv = phi i64 [ undef, %entry ], [ %outer.iv.next, %outer.latch ]
|
|
%idx = getelementptr inbounds double, ptr undef, i64 %outer.iv
|
|
br label %inner
|
|
|
|
inner: ; preds = %for.body28.us, %for.body25.us
|
|
%inner.iv = phi i64 [ 0, %outer.header ], [ %inner.iv.next, %inner ]
|
|
%0 = load double, ptr %idx, align 8
|
|
store double undef, ptr %idx, align 8
|
|
%inner.iv.next = add nuw nsw i64 %inner.iv, 1
|
|
br i1 %arg, label %inner, label %outer.latch
|
|
|
|
outer.latch: ; preds = %inner
|
|
%inc43.lcssa.wide.us = phi i64 [ %inner.iv.next, %inner ]
|
|
%1 = trunc i64 %inc43.lcssa.wide.us to i32
|
|
%outer.iv.next = add nsw i64 %outer.iv, 1
|
|
br i1 %arg, label %outer.header, label %outer.exit
|
|
|
|
outer.exit: ; preds = %for.cond26.for.end44_crit_edge.us
|
|
ret void
|
|
}
|
|
|
|
; Same as @test1, but with a dedicated inner loop exit block.
|
|
define void @test2(i1 %arg) {
|
|
; CHECK-LABEL: define void @test2(
|
|
; CHECK-SAME: i1 [[ARG:%.*]]) {
|
|
; CHECK-NEXT: [[ENTRY:.*]]:
|
|
; CHECK-NEXT: br label %[[OUTER_HEADER:.*]]
|
|
; CHECK: [[OUTER_HEADER]]:
|
|
; CHECK-NEXT: [[OUTER_IV:%.*]] = phi i64 [ undef, %[[ENTRY]] ], [ [[OUTER_IV_NEXT:%.*]], %[[OUTER_LATCH:.*]] ]
|
|
; CHECK-NEXT: [[IDX:%.*]] = getelementptr inbounds double, ptr undef, i64 [[OUTER_IV]]
|
|
; CHECK-NEXT: br label %[[INNER:.*]]
|
|
; CHECK: [[INNER]]:
|
|
; CHECK-NEXT: [[INNER_IV:%.*]] = phi i64 [ 0, %[[OUTER_HEADER]] ], [ [[INNER_IV_NEXT:%.*]], %[[INNER]] ]
|
|
; CHECK-NEXT: [[TMP0:%.*]] = load double, ptr [[IDX]], align 8
|
|
; CHECK-NEXT: store double undef, ptr [[IDX]], align 8
|
|
; CHECK-NEXT: [[INNER_IV_NEXT]] = add nuw nsw i64 [[INNER_IV]], 1
|
|
; CHECK-NEXT: br i1 [[ARG]], label %[[INNER]], label %[[INNER_EXIT:.*]]
|
|
; CHECK: [[INNER_EXIT]]:
|
|
; CHECK-NEXT: [[INC43_LCSSA_WIDE_US:%.*]] = phi i64 [ [[INNER_IV_NEXT]], %[[INNER]] ]
|
|
; CHECK-NEXT: br label %[[OUTER_LATCH]]
|
|
; CHECK: [[OUTER_LATCH]]:
|
|
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[INC43_LCSSA_WIDE_US]] to i32
|
|
; CHECK-NEXT: [[OUTER_IV_NEXT]] = add nsw i64 [[OUTER_IV]], 1
|
|
; CHECK-NEXT: br i1 [[ARG]], label %[[OUTER_HEADER]], label %[[OUTER_EXIT:.*]]
|
|
; CHECK: [[OUTER_EXIT]]:
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
entry:
|
|
br label %outer.header
|
|
|
|
outer.header: ; preds = %for.cond26.for.end44_crit_edge.us, %entry
|
|
%outer.iv = phi i64 [ undef, %entry ], [ %outer.iv.next, %outer.latch ]
|
|
%idx = getelementptr inbounds double, ptr undef, i64 %outer.iv
|
|
br label %inner
|
|
|
|
inner: ; preds = %for.body28.us, %for.body25.us
|
|
%inner.iv = phi i64 [ 0, %outer.header ], [ %inner.iv.next, %inner ]
|
|
%0 = load double, ptr %idx, align 8
|
|
store double undef, ptr %idx, align 8
|
|
%inner.iv.next = add nuw nsw i64 %inner.iv, 1
|
|
br i1 %arg, label %inner, label %inner.exit
|
|
|
|
inner.exit:
|
|
%inc43.lcssa.wide.us = phi i64 [ %inner.iv.next, %inner ]
|
|
br label %outer.latch
|
|
|
|
outer.latch: ; preds = %inner
|
|
%1 = trunc i64 %inc43.lcssa.wide.us to i32
|
|
%outer.iv.next = add nsw i64 %outer.iv, 1
|
|
br i1 %arg, label %outer.header, label %outer.exit
|
|
|
|
outer.exit: ; preds = %for.cond26.for.end44_crit_edge.us
|
|
ret void
|
|
}
|
|
|