It seems that the check that rejects loops without data references is
only included to avoid handling non-profitable loops.  Including those
loops in Graphite's analysis enables more consistent diagnostic
messages in OpenACC "kernels" code and does not introduce any
testsuite regressions.  If executing Graphite on loops without
data references leads to noticeable compile time slow-downs for
non-OpenACC users of Graphite, the check can be re-introduced but
restricted to non-OpenACC functions.

gcc/ChangeLog:

        * graphite-scop-detection.c (scop_detection::harmful_loop_in_region):
        Remove check for loops without data references.
---
 gcc/graphite-scop-detection.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 99e906a5d120..9311a0e42a57 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -851,19 +851,6 @@ scop_detection::harmful_loop_in_region (sese_l scop) const
          return true;
        }

-      /* Check if all loop nests have at least one data reference.
-        ???  This check is expensive and loops premature at this point.
-        If important to retain we can pre-compute this for all innermost
-        loops and reject those when we build a SESE region for a loop
-        during SESE discovery.  */
-      if (! loop->inner
-         && ! loop_nest_has_data_refs (loop))
-       {
-         DEBUG_PRINT (dp << "[scop-detection-fail] loop_" << loop->num
-                      << " does not have any data reference.\n");
-         return true;
-       }
-
       DEBUG_PRINT (dp << "[scop-detection] loop_" << loop->num << " is 
harmless.\n");
     }

--
2.33.0

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to