[llvm] 3c14836 - [LAA] Add test with simpler load of pointer select.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 10 14:55:33 PDT 2022


Author: Florian Hahn
Date: 2022-04-10T23:54:41+02:00
New Revision: 3c1483609369559ecb6b40c60ca0366759332767

URL: https://github.com/llvm/llvm-project/commit/3c1483609369559ecb6b40c60ca0366759332767
DIFF: https://github.com/llvm/llvm-project/commit/3c1483609369559ecb6b40c60ca0366759332767.diff

LOG: [LAA] Add test with simpler load of pointer select.

Add a simpler test for D114487/D108699.

Added: 
    

Modified: 
    llvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll b/llvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll
index 31d65bd5cc03d..f0dbc35588896 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll
@@ -2,6 +2,41 @@
 
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
 
+; CHECK-LABEL: function 'forked_ptrs_simple':
+; CHECK-NEXT:  loop:
+; CHECK-NEXT:    Report: cannot identify array bounds
+; CHECK-NEXT:    Dependences:
+; CHECK-NEXT:    Run-time memory checks:
+; CHECK-NEXT:    Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT:    Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT:    SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT:    Expressions re-written:
+
+define void @forked_ptrs_simple(float* nocapture readonly %Base1, float* nocapture readonly %Base2, float* %Dest) {
+entry:
+  br label %loop
+
+loop:
+  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
+  %gep.Dest = getelementptr inbounds float, float* %Dest, i64 %iv
+  %l.Dest = load float, float* %gep.Dest
+  %cmp = fcmp une float %l.Dest, 0.0
+  %gep.1 = getelementptr inbounds float, float* %Base1, i64 %iv
+  %gep.2 = getelementptr inbounds float, float* %Base2, i64 %iv
+  %select = select i1 %cmp, float* %gep.1, float* %gep.2
+  %sink = load float, float* %select, align 4
+  store float %sink, float* %gep.Dest, align 4
+  %iv.next = add nuw nsw i64 %iv, 1
+  %exitcond.not = icmp eq i64 %iv.next, 100
+  br i1 %exitcond.not, label %exit, label %loop
+
+exit:
+  ret void
+}
+
+
 ; CHECK-LABEL: function 'forked_ptrs_
diff erent_base_same_offset':
 ; CHECK-NEXT:  for.body:
 ; CHECK-NEXT:    Report: cannot identify array bounds


        


More information about the llvm-commits mailing list