[llvm] ac15a12 - [NFC] Add getUnderlyingObjects test
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 21 16:37:02 PDT 2021
Author: Vitaly Buka
Date: 2021-06-21T16:36:50-07:00
New Revision: ac15a128d8756074b150bb5cb11bfd93a1a5c30c
URL: https://github.com/llvm/llvm-project/commit/ac15a128d8756074b150bb5cb11bfd93a1a5c30c
DIFF: https://github.com/llvm/llvm-project/commit/ac15a128d8756074b150bb5cb11bfd93a1a5c30c.diff
LOG: [NFC] Add getUnderlyingObjects test
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D104585
Added:
Modified:
llvm/test/Analysis/LoopAccessAnalysis/underlying-objects-2.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/underlying-objects-2.ll b/llvm/test/Analysis/LoopAccessAnalysis/underlying-objects-2.ll
index 3fd1f72cdce3..a067dc2f0c0c 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/underlying-objects-2.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/underlying-objects-2.ll
@@ -37,6 +37,7 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
+; CHECK-LABEL: function 'f'
; CHECK: for_j.body:
; CHECK-NEXT: Report: unsafe dependent memory operations in loop
; CHECK-NEXT: Dependences:
@@ -89,3 +90,64 @@ for_j.end:
for_i.end:
ret void
}
+
+; CHECK-LABEL: function 'f_deep'
+; CHECK: for_j.body:
+; FIXME: This is incorrect and is going to be fixed with D86669.
+; CHECK-NEXT: Memory dependences are safe with run-time checks
+; CHECK-NEXT: Dependences:
+
+define void @f_deep(i8** noalias %A, i8* noalias %B, i64 %N) {
+for_i.preheader:
+ %prev_0 = load i8*, i8** %A, align 8
+ br label %for_i.body
+
+for_i.body:
+ %i = phi i64 [1, %for_i.preheader], [%i.1, %for_j.end]
+ %prev = phi i8* [%prev_0, %for_i.preheader], [%curr, %for_j.end]
+ %gep = getelementptr inbounds i8*, i8** %A, i64 %i
+ %curr = load i8*, i8** %gep, align 8
+ br label %for_j.preheader
+
+for_j.preheader:
+ br label %for_j.body
+
+for_j.body:
+ %j = phi i64 [0, %for_j.preheader], [%j.1, %for_j.body]
+
+ %gepPrev = getelementptr inbounds i8, i8* %prev, i64 %j
+ %gepCurr = getelementptr inbounds i8, i8* %curr, i64 %j
+ %gepB = getelementptr inbounds i8, i8* %B, i64 %j
+ %gepB1 = getelementptr inbounds i8, i8* %gepB, i64 %j
+ %gepB2 = getelementptr inbounds i8, i8* %gepB1, i64 0
+ %gepB3 = getelementptr inbounds i8, i8* %gepB2, i64 0
+ %gepB4 = getelementptr inbounds i8, i8* %gepB3, i64 0
+ %gepB5 = getelementptr inbounds i8, i8* %gepB4, i64 0
+ %gepB6 = getelementptr inbounds i8, i8* %gepB5, i64 0
+ %gepB7 = getelementptr inbounds i8, i8* %gepB6, i64 0
+ %gepB8 = getelementptr inbounds i8, i8* %gepB7, i64 0
+ %gepB9 = getelementptr inbounds i8, i8* %gepB8, i64 0
+
+ %loadPrev = load i8, i8* %gepPrev, align 1
+ %loadB = load i8, i8* %gepB9, align 1
+
+ %mul = mul i8 %loadPrev, %loadB
+
+ store i8 %mul, i8* %gepCurr, align 1
+
+ %gepB_plus_one = getelementptr inbounds i8, i8* %gepB, i64 1
+ store i8 2, i8* %gepB_plus_one, align 1
+
+ %j.1 = add nuw i64 %j, 1
+ %exitcondj = icmp eq i64 %j.1, %N
+ br i1 %exitcondj, label %for_j.end, label %for_j.body
+
+for_j.end:
+
+ %i.1 = add nuw i64 %i, 1
+ %exitcond = icmp eq i64 %i.1, %N
+ br i1 %exitcond, label %for_i.end, label %for_i.body
+
+for_i.end:
+ ret void
+}
More information about the llvm-commits
mailing list