Files
TheRock/compiler/amd-llvm/polly/test/ScopInfo/invariant_loads_cyclic_dependences.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

64 lines
2.4 KiB
LLVM

; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-detect -polly-print-scops -polly-invariant-load-hoisting=true -disable-output < %s 2>&1 | FileCheck %s
;
; Negative test. If we assume UB[*V] to be invariant we get a cyclic
; dependence in the invariant loads that needs to be resolved by
; ignoring the actual accessed address and focusing on the fact
; that the access happened. However, at the moment we assume UB[*V]
; not to be loop invariant, thus reject this region.
;
; CHECK-NOT: Statements
;
;
; void f(int *restrict V, int *restrict UB, int *restrict A) {
; for (int i = 0; i < 100; i++) {
; int j = 0;
; int x = 0;
; do {
; x = /* invariant load dependent on UB[*V] */ *V;
; A[j + i]++;
; } while (j++ < /* invariant load dependent on *V */ UB[x]);
; }
; }
;
target datalayout = "e-m:e-i32:64-f80:128-n8:16:32:64-S128"
define void @f(ptr noalias %V, ptr noalias %UB, ptr noalias %A) {
entry:
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv2 = phi i32 [ %indvars.iv.next3, %for.inc ], [ 0, %entry ]
%exitcond = icmp ne i32 %indvars.iv2, 100
br i1 %exitcond, label %for.body, label %for.end
for.body: ; preds = %for.cond
br label %do.body
do.body: ; preds = %do.cond, %for.body
%indvars.iv = phi i32 [ %indvars.iv.next, %do.cond ], [ 0, %for.body ]
%tmp = load i32, ptr %V, align 4
%tmp4 = add nuw nsw i32 %indvars.iv, %indvars.iv2
%arrayidx = getelementptr inbounds i32, ptr %A, i32 %tmp4
%tmp5 = load i32, ptr %arrayidx, align 4
%inc = add nsw i32 %tmp5, 1
store i32 %inc, ptr %arrayidx, align 4
br label %do.cond
do.cond: ; preds = %do.body
%indvars.iv.next = add nuw nsw i32 %indvars.iv, 1
%arrayidx3 = getelementptr inbounds i32, ptr %UB, i32 %tmp
%tmp6 = load i32, ptr %arrayidx3, align 4
%cmp4 = icmp slt i32 %indvars.iv, %tmp6
br i1 %cmp4, label %do.body, label %do.end
do.end: ; preds = %do.cond
br label %for.inc
for.inc: ; preds = %do.end
%indvars.iv.next3 = add nuw nsw i32 %indvars.iv2, 1
br label %for.cond
for.end: ; preds = %for.cond
ret void
}