Files
TheRock/compiler/amd-llvm/llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-addrec-wrap.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

109 lines
3.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 6
; RUN: opt < %s -disable-output "-passes=print<da>" 2>&1 \
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-ALL
; RUN: opt < %s -disable-output "-passes=print<da>" -da-enable-dependence-test=weak-zero-siv 2>&1 \
; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-WEAK-ZERO-SIV
;
; coeff = (1 << 62) - 1;
; // Use `i*i <u n` to make the BTC unpredictable.
; for (i = 0; i*i <u n; i++) {
; A[-4] = 0;
; if (i == 4)
; A[coeff*i] = 1;
; }
;
; When `n` is large enough, there exists a dependency with all directions between the two stores.
;
; memory access | i == 0 | i == 4 | i == 5
; ---------------|--------|--------|--------
; A[-4] | A[-4] | A[-4] | A[-4]
; A[(2^62-1)*i] | | A[-4] |
;
define void @weak_zero_src_siv_addrec_wrap(ptr %A, i64 %n) {
; CHECK-LABEL: 'weak_zero_src_siv_addrec_wrap'
; CHECK-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
; CHECK-NEXT: da analyze - output [S]!
; CHECK-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
; CHECK-NEXT: da analyze - output [*|<]!
; CHECK-NEXT: Src: store i8 1, ptr %gep.1, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
; CHECK-NEXT: da analyze - output [*]!
;
entry:
br label %loop.header
loop.header:
%i = phi i64 [ 0, %entry ], [ %i.inc, %loop.latch ]
%gep.0 = getelementptr i8, ptr %A, i64 -4
store i8 0, ptr %gep.0
%cond = icmp eq i64 %i, 4
br i1 %cond, label %if.then, label %loop.latch
if.then:
%offset = mul i64 4611686018427387903, %i
%gep.1 = getelementptr i8, ptr %A, i64 %offset
store i8 1, ptr %gep.1
br label %loop.latch
loop.latch:
%i.inc = add nuw nsw i64 %i, 1
%sq = mul nuw nsw i64 %i.inc, %i.inc
%ec = icmp uge i64 %sq, %n
br i1 %ec, label %exit, label %loop.header
exit:
ret void
}
; coeff = (1 << 62) - 1;
; // Use `i*i <u n` to make the BTC unpredictable.
; for (i = 0; i*i <u n; i++) {
; if (i == 4)
; A[coeff*i] = 0;
; A[-4] = 1;
; }
;
; When `n` is large enough, there exists a dependency with all directions between the two stores.
;
; memory access | i == 0 | i == 4 | i == 5
; ---------------|--------|--------|--------
; A[(2^62-1)*i] | | A[-4] |
; A[-4] | A[-4] | A[-4] | A[-4]
;
define void @weak_zero_dst_siv_addrec_wrap(ptr %A, i64 %n) {
; CHECK-LABEL: 'weak_zero_dst_siv_addrec_wrap'
; CHECK-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 0, ptr %gep.0, align 1
; CHECK-NEXT: da analyze - output [*]!
; CHECK-NEXT: Src: store i8 0, ptr %gep.0, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
; CHECK-NEXT: da analyze - output [*|<]!
; CHECK-NEXT: Src: store i8 1, ptr %gep.1, align 1 --> Dst: store i8 1, ptr %gep.1, align 1
; CHECK-NEXT: da analyze - output [S]!
;
entry:
br label %loop.header
loop.header:
%i = phi i64 [ 0, %entry ], [ %i.inc, %loop.latch ]
%cond = icmp eq i64 %i, 4
br i1 %cond, label %if.then, label %loop.latch
if.then:
%offset = mul i64 4611686018427387903, %i
%gep.0 = getelementptr i8, ptr %A, i64 %offset
store i8 0, ptr %gep.0
br label %loop.latch
loop.latch:
%gep.1 = getelementptr i8, ptr %A, i64 -4
store i8 1, ptr %gep.1
%i.inc = add nuw nsw i64 %i, 1
%sq = mul nuw nsw i64 %i.inc, %i.inc
%ec = icmp uge i64 %sq, %n
br i1 %ec, label %exit, label %loop.header
exit:
ret void
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK-ALL: {{.*}}
; CHECK-WEAK-ZERO-SIV: {{.*}}