]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support for unroll and jam optimization.
authorMircea Namolaru <mircea.namolaru@inria.fr>
Mon, 17 Nov 2014 22:59:07 +0000 (23:59 +0100)
committerMircea Namolaru <mircea@gcc.gnu.org>
Mon, 17 Nov 2014 22:59:07 +0000 (22:59 +0000)
From-SVN: r217682

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/graphite-optimize-isl.c

index d936a923fe0a6391b5d1e92845a57506629a27c0..a04b10a35759a1b5f6b544d36ebde5ff4fa31217 100644 (file)
@@ -1,3 +1,11 @@
+2014-11-17  Mircea Namolaru  <mircea.namolaru@inria.fr>
+
+       * doc/invoke.texi (floop-unroll-and-jam): Document
+       (loop-unroll-jam-size): Likewise.
+       (loop-unroll-jam-depth): Likewise.
+       * graphite-optimize-isl.c (getPrevectorMap_full): Modify comment.
+       (getScheduleForBandList): Replaced unsafe union_map reuse.
+
 2014-11-17  Andrew Pinski  <apinski@cavium.com>
 
        * config/aarch64/thunderx.md: Remove copyright which should not
index 9846a73079d67b89129e55b4dc752537ea1d07e4..89edddb4712baa6c508eb3986fb3f7ead621a6b4 100644 (file)
@@ -391,7 +391,8 @@ Objective-C and Objective-C++ Dialects}.
 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
 -fivopts -fkeep-inline-functions -fkeep-static-consts -flive-range-shrinkage @gol
--floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
+-floop-block -floop-interchange -floop-strip-mine @gol  
+-floop-unroll-and-jam -floop-nest-optimize @gol
 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
 -flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
@@ -8352,6 +8353,13 @@ optimizer based on the Pluto optimization algorithms.  It calculates a loop
 structure optimized for data-locality and parallelism.  This option
 is experimental.
 
+@item -floop-unroll-and-jam
+@opindex floop-unroll-and-jam
+Enable unroll and jam for the ISL based loop nest optimizer.  The unroll 
+factor can be changed using the @option{loop-unroll-jam-size} parameter.
+The unrolled dimension (counting from the most inner one) can be changed 
+using the @option{loop-unroll-jam-depth} parameter.                 .
+
 @item -floop-parallelize-all
 @opindex floop-parallelize-all
 Use the Graphite data dependence analysis to identify loops that can
@@ -10469,6 +10477,14 @@ loop in the loop nest by a given number of iterations.  The strip
 length can be changed using the @option{loop-block-tile-size}
 parameter.  The default value is 51 iterations.
 
+@item loop-unroll-jam-size
+Specify the unroll factor for the @option{-floop-unroll-and-jam}.  The 
+default value is 4.
+
+@item loop-unroll-jam-depth
+Specify the dimension to be unrolled (counting from the most inner loop)
+for the  @option{-floop-unroll-and-jam}.  The default value is 2.
+
 @item ipa-cp-value-list-size
 IPA-CP attempts to track all possible values and types passed to a function's
 parameter in order to propagate them and perform devirtualization.
index cbab82022446f078093ca28f4211dd70231d53c3..195101a35727adda22f44ccaa0558ea86018633b 100644 (file)
@@ -320,7 +320,7 @@ getPrevectorMap (isl_ctx *ctx, int DimToVectorize,
                         ip >= 0
 
    The image of this map is the separation class. The range of this map includes
-   all the i that are multiple of 4 in the domain beside the greater one. 
+   all the i multiple of 4 in the domain such as i + 3 is in the domain too.
     
  */ 
 static isl_map *
@@ -486,20 +486,25 @@ getScheduleForBandList (isl_band_list *BandList, isl_union_map **map_sepcl)
                }       
            }
        }
-      Schedule = isl_union_map_union (Schedule, PartialSchedule);
+      Schedule = isl_union_map_union (Schedule, 
+                                      isl_union_map_copy(PartialSchedule));
 
       isl_band_free (Band);
       isl_space_free (Space);
 
       if (!flag_loop_unroll_jam)
-       continue;
+       {
+          isl_union_map_free (PartialSchedule);
+          continue;
+       }
 
       if (PartialSchedule_f)
-       *map_sepcl = isl_union_map_union (*map_sepcl, 
-                                         PartialSchedule_f);
+       {
+         *map_sepcl = isl_union_map_union (*map_sepcl, PartialSchedule_f);
+          isl_union_map_free (PartialSchedule);
+       }
       else
-        *map_sepcl = isl_union_map_union (*map_sepcl, 
-                                         isl_union_map_copy (PartialSchedule));
+        *map_sepcl = isl_union_map_union (*map_sepcl, PartialSchedule);
     }
 
   return Schedule;