[polly] r250517 - Avoid unnecessay .s2a write access when used only in PHIs

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 08:14:42 PDT 2015


Author: meinersbur
Date: Fri Oct 16 10:14:40 2015
New Revision: 250517

URL: http://llvm.org/viewvc/llvm-project?rev=250517&view=rev
Log:
Avoid unnecessay .s2a write access when used only in PHIs

PHI accesses will be handled separately by buildPHIAccesses,
buildScalarDependences does not need to create additional accesses.


Modified:
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
    polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
    polly/trunk/test/ScopInfo/read-only-scalar-used-in-phi.ll

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=250517&r1=250516&r2=250517&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Oct 16 10:14:40 2015
@@ -3272,7 +3272,7 @@ bool ScopInfo::buildScalarDependences(In
       continue;
 
     // Check whether or not the use is in the SCoP.
-    if (!R->contains(UseParent)) {
+    if (!isa<PHINode>(UI) && !R->contains(UseParent)) {
       AnyCrossStmtUse = true;
       continue;
     }

Modified: polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll?rev=250517&r1=250516&r2=250517&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll Fri Oct 16 10:14:40 2015
@@ -29,7 +29,7 @@
 ; INNERMOST:            Domain :=
 ; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb16[i0] : i0 <= 1023 - p_0 and i0 >= 0 }
 ; INNERMOST:            Schedule :=
-; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb16[i0] -> [0, i0] }
+; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb16[i0] -> [i0] }
 ; INNERMOST:            ReadAccess := [Reduction Type: NONE] [Scalar: 0]
 ; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb16[i0] -> MemRef_A[o0] : 4o0 = p_1 };
 ; INNERMOST:            ReadAccess := [Reduction Type: NONE] [Scalar: 0]
@@ -38,15 +38,6 @@
 ; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb16[i0] -> MemRef_A[o0] : 4o0 = p_3 + 4i0 };
 ; INNERMOST:            MustWriteAccess :=  [Reduction Type: +] [Scalar: 0]
 ; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb16[i0] -> MemRef_A[o0] : 4o0 = p_3 + 4i0 };
-; INNERMOST:      Stmt_bb26
-; INNERMOST:            Domain :=
-; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb26[] : p_0 <= 1024 };
-; INNERMOST:            Schedule :=
-; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb26[] -> [1, 0] };
-; INNERMOST:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
-; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb26[] -> MemRef_indvars_iv_next6[] };
-; INNERMOST:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
-; INNERMOST:                [p_0, p_1, p_2, p_3] -> { Stmt_bb26[] -> MemRef_indvars_iv_next4[] };
 ; INNERMOST:    }
 ;
 ; ALL:    Function: f

Modified: polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll?rev=250517&r1=250516&r2=250517&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll Fri Oct 16 10:14:40 2015
@@ -47,7 +47,7 @@
 ; INNERMOST-DAG:               i0 <= -1 + p_0
 ; INNERMOST-DAG:             };
 ; INNERMOST:            Schedule :=
-; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb16[i0] -> [0, i0] };
+; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb16[i0] -> [i0] };
 ; INNERMOST:            ReadAccess := [Reduction Type: NONE] [Scalar: 0]
 ; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb16[i0] -> MemRef_A[o0] : 4o0 = p_1 };
 ; INNERMOST:            ReadAccess := [Reduction Type: NONE] [Scalar: 0]
@@ -56,15 +56,6 @@
 ; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb16[i0] -> MemRef_A[i0] };
 ; INNERMOST:            MustWriteAccess :=  [Reduction Type: +] [Scalar: 0]
 ; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb16[i0] -> MemRef_A[i0] };
-; INNERMOST:      Stmt_bb26
-; INNERMOST:            Domain :=
-; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb26[] :  p_0 >= 0 };
-; INNERMOST:            Schedule :=
-; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb26[] -> [1, 0] };
-; INNERMOST:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
-; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb26[] -> MemRef_indvars_iv_next6[] };
-; INNERMOST:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
-; INNERMOST:                [p_0, p_1, p_2] -> { Stmt_bb26[] -> MemRef_indvars_iv_next4[] };
 ; INNERMOST:    }
 ;
 ; ALL:    Function: f

Modified: polly/trunk/test/ScopInfo/read-only-scalar-used-in-phi.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/read-only-scalar-used-in-phi.ll?rev=250517&r1=250516&r2=250517&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/read-only-scalar-used-in-phi.ll (original)
+++ polly/trunk/test/ScopInfo/read-only-scalar-used-in-phi.ll Fri Oct 16 10:14:40 2015
@@ -27,8 +27,6 @@
 ; CHECK:           { Stmt_bb1[i0] -> MemRef_phisum__phi[] };
 ; CHECK:       ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
 ; CHECK:           { Stmt_bb1[i0] -> MemRef_phisum__phi[] };
-; CHECK:       MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
-; CHECK:           { Stmt_bb1[i0] -> MemRef_phisum[] };
 ; CHECK:       ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
 ; CHECK:           { Stmt_bb1[i0] -> MemRef_A[i0] };
 




More information about the llvm-commits mailing list