[polly] r310385 - [test] Add descriptions and pseudocode to tests. NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 10:26:19 PDT 2017


Author: meinersbur
Date: Tue Aug  8 10:26:19 2017
New Revision: 310385

URL: http://llvm.org/viewvc/llvm-project?rev=310385&view=rev
Log:
[test] Add descriptions and pseudocode to tests. NFC.

Modified:
    polly/trunk/test/ForwardOpTree/forward_hoisted.ll
    polly/trunk/test/ForwardOpTree/forward_load.ll
    polly/trunk/test/ForwardOpTree/forward_load_differentarray.ll
    polly/trunk/test/ForwardOpTree/forward_load_fromloop.ll
    polly/trunk/test/ForwardOpTree/forward_load_indirect.ll
    polly/trunk/test/ForwardOpTree/forward_load_tripleuse.ll
    polly/trunk/test/ForwardOpTree/noforward_load_conditional.ll
    polly/trunk/test/ForwardOpTree/noforward_load_writebetween.ll

Modified: polly/trunk/test/ForwardOpTree/forward_hoisted.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/forward_hoisted.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/forward_hoisted.ll (original)
+++ polly/trunk/test/ForwardOpTree/forward_hoisted.ll Tue Aug  8 10:26:19 2017
@@ -1,6 +1,7 @@
 ; RUN: opt %loadPolly -polly-invariant-load-hoisting=true -polly-optree -analyze < %s | FileCheck %s -match-full-lines
 ;
-; Move %val to %bodyB, so %bodyA can be removed (by -polly-simplify)
+; Move %val to %bodyB, so %bodyA can be removed (by -polly-simplify).
+; This involves making the load-hoisted %val1 to be made available in %bodyB.
 ;
 ; for (int j = 0; j < n; j += 1) {
 ; bodyA:

Modified: polly/trunk/test/ForwardOpTree/forward_load.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/forward_load.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/forward_load.ll (original)
+++ polly/trunk/test/ForwardOpTree/forward_load.ll Tue Aug  8 10:26:19 2017
@@ -2,6 +2,14 @@
 ;
 ; Rematerialize a load.
 ;
+; for (int j = 0; j < n; j += 1) {
+; bodyA:
+;   double val = B[j];
+;
+; bodyB:
+;   A[j] = val;
+; }
+;
 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
 entry:
   br label %for

Modified: polly/trunk/test/ForwardOpTree/forward_load_differentarray.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/forward_load_differentarray.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/forward_load_differentarray.ll (original)
+++ polly/trunk/test/ForwardOpTree/forward_load_differentarray.ll Tue Aug  8 10:26:19 2017
@@ -1,5 +1,20 @@
 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines
 ;
+; To forward %val, B[j] cannot be reused in bodyC because it is overwritten
+; between. Verify that instead the alternative C[j] is used.
+;
+; for (int j = 0; j < n; j += 1) {
+; bodyA:
+;   double val = B[j];
+;
+; bodyB:
+;   B[j] = 0;
+;   C[j] = val;
+;
+; bodyC:
+;   A[j] = val;
+; }
+;
 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B, double* noalias nonnull %C) {
 entry:
   br label %for

Modified: polly/trunk/test/ForwardOpTree/forward_load_fromloop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/forward_load_fromloop.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/forward_load_fromloop.ll (original)
+++ polly/trunk/test/ForwardOpTree/forward_load_fromloop.ll Tue Aug  8 10:26:19 2017
@@ -1,5 +1,19 @@
 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines
 ;
+; Forward a the LoadInst %val into %bodyB. %val is executed multiple times,
+; we must get the last loaded values.
+;
+; for (int j = 0; j < n; j += 1) {
+;   double val;
+;   for (int i = 0; i < n; i += 1) {
+; bodyA:
+;     val = B[j];
+;   }
+;
+; bodyB:
+;   A[j] = val;
+; }
+;
 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
 entry:
   br label %for

Modified: polly/trunk/test/ForwardOpTree/forward_load_indirect.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/forward_load_indirect.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/forward_load_indirect.ll (original)
+++ polly/trunk/test/ForwardOpTree/forward_load_indirect.ll Tue Aug  8 10:26:19 2017
@@ -1,5 +1,17 @@
 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines
 ;
+; Forward an operand tree consisting of a speculatable instruction (%add)
+; and a load (%val).
+;
+; for (int j = 0; j < n; j += 1) {
+; bodyA:
+;   double val = B[j];
+;   double add = val + 42.0;
+;
+; bodyB:
+;   A[j] = add;
+; }
+;
 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
 entry:
   br label %for

Modified: polly/trunk/test/ForwardOpTree/forward_load_tripleuse.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/forward_load_tripleuse.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/forward_load_tripleuse.ll (original)
+++ polly/trunk/test/ForwardOpTree/forward_load_tripleuse.ll Tue Aug  8 10:26:19 2017
@@ -1,5 +1,22 @@
 ; RUN: opt %loadPolly -polly-optree -polly-codegen -analyze < %s | FileCheck %s -match-full-lines
 ;
+; %val1 is used three times: Twice by its own operand tree of %val2 and once
+; more by the store in %bodyB.
+; Verify that we can handle multiple uses by the same instruction and uses
+; in multiple statements as well.
+; The result processing may depend on the order in which the values are used,
+; hence we check both orderings.
+;
+; for (int j = 0; j < n; j += 1) {
+; bodyA:
+;   double val1 = A[j];
+;   double val2 = val1 + val1;
+;
+; bodyB:
+;   B[j] = val1;
+;   C[j] = val2;
+; }
+;
 define void @func1(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B, double* noalias nonnull %C) {
 entry:
   br label %for

Modified: polly/trunk/test/ForwardOpTree/noforward_load_conditional.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/noforward_load_conditional.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/noforward_load_conditional.ll (original)
+++ polly/trunk/test/ForwardOpTree/noforward_load_conditional.ll Tue Aug  8 10:26:19 2017
@@ -1,5 +1,20 @@
 ; RUN: opt %loadPolly -polly-optree -analyze < %s | FileCheck %s -match-full-lines
 ;
+; B[j] is overwritten by at least one statement between the
+; definition of %val and its use. Hence, it cannot be forwarded.
+;
+; for (int j = 0; j < n; j += 1) {
+; bodyA:
+;   double val = B[j];
+;   if (j < 1) {
+; bodyA_true:
+;     B[j] = 0.0;
+;   }
+;
+; bodyB:
+;   A[j] = val;
+; }
+;
 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
 entry:
   br label %for

Modified: polly/trunk/test/ForwardOpTree/noforward_load_writebetween.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ForwardOpTree/noforward_load_writebetween.ll?rev=310385&r1=310384&r2=310385&view=diff
==============================================================================
--- polly/trunk/test/ForwardOpTree/noforward_load_writebetween.ll (original)
+++ polly/trunk/test/ForwardOpTree/noforward_load_writebetween.ll Tue Aug  8 10:26:19 2017
@@ -3,6 +3,17 @@
 ; Cannot rematerialize %val from B[0] at bodyC because B[0] has been
 ; overwritten in bodyB.
 ;
+; for (int j = 0; j < n; j += 1) {
+; bodyA:
+;   double val = B[j];
+;
+; bodyB:
+;   B[j] = 0.0;
+;
+; bodyC:
+;   A[j] = val;
+; }
+;
 define void @func(i32 %n, double* noalias nonnull %A, double* noalias nonnull %B) {
 entry:
   br label %for




More information about the llvm-commits mailing list