ScheduleOptimizer.cpp 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. //===- ScheduleOptimizer.cpp - Calculate an optimized schedule ------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This pass generates an entirely new schedule tree from the data dependences
  10. // and iteration domains. The new schedule tree is computed in two steps:
  11. //
  12. // 1) The isl scheduling optimizer is run
  13. //
  14. // The isl scheduling optimizer creates a new schedule tree that maximizes
  15. // parallelism and tileability and minimizes data-dependence distances. The
  16. // algorithm used is a modified version of the ``Pluto'' algorithm:
  17. //
  18. // U. Bondhugula, A. Hartono, J. Ramanujam, and P. Sadayappan.
  19. // A Practical Automatic Polyhedral Parallelizer and Locality Optimizer.
  20. // In Proceedings of the 2008 ACM SIGPLAN Conference On Programming Language
  21. // Design and Implementation, PLDI ’08, pages 101–113. ACM, 2008.
  22. //
  23. // 2) A set of post-scheduling transformations is applied on the schedule tree.
  24. //
  25. // These optimizations include:
  26. //
  27. // - Tiling of the innermost tilable bands
  28. // - Prevectorization - The choice of a possible outer loop that is strip-mined
  29. // to the innermost level to enable inner-loop
  30. // vectorization.
  31. // - Some optimizations for spatial locality are also planned.
  32. //
  33. // For a detailed description of the schedule tree itself please see section 6
  34. // of:
  35. //
  36. // Polyhedral AST generation is more than scanning polyhedra
  37. // Tobias Grosser, Sven Verdoolaege, Albert Cohen
  38. // ACM Transactions on Programming Languages and Systems (TOPLAS),
  39. // 37(4), July 2015
  40. // http://www.grosser.es/#pub-polyhedral-AST-generation
  41. //
  42. // This publication also contains a detailed discussion of the different options
  43. // for polyhedral loop unrolling, full/partial tile separation and other uses
  44. // of the schedule tree.
  45. //
  46. //===----------------------------------------------------------------------===//
  47. #include "polly/ScheduleOptimizer.h"
  48. #include "polly/CodeGen/CodeGeneration.h"
  49. #include "polly/DependenceInfo.h"
  50. #include "polly/ManualOptimizer.h"
  51. #include "polly/MatmulOptimizer.h"
  52. #include "polly/Options.h"
  53. #include "polly/ScheduleTreeTransform.h"
  54. #include "polly/Support/ISLOStream.h"
  55. #include "polly/Support/ISLTools.h"
  56. #include "llvm/ADT/Sequence.h"
  57. #include "llvm/ADT/Statistic.h"
  58. #include "llvm/Analysis/OptimizationRemarkEmitter.h"
  59. #include "llvm/InitializePasses.h"
  60. #include "llvm/Support/CommandLine.h"
  61. #include "isl/options.h"
  62. using namespace llvm;
  63. using namespace polly;
  64. namespace llvm {
  65. class Loop;
  66. class Module;
  67. } // namespace llvm
  68. #define DEBUG_TYPE "polly-opt-isl"
  69. static cl::opt<std::string>
  70. OptimizeDeps("polly-opt-optimize-only",
  71. cl::desc("Only a certain kind of dependences (all/raw)"),
  72. cl::Hidden, cl::init("all"), cl::cat(PollyCategory));
  73. static cl::opt<std::string>
  74. SimplifyDeps("polly-opt-simplify-deps",
  75. cl::desc("Dependences should be simplified (yes/no)"),
  76. cl::Hidden, cl::init("yes"), cl::cat(PollyCategory));
  77. static cl::opt<int> MaxConstantTerm(
  78. "polly-opt-max-constant-term",
  79. cl::desc("The maximal constant term allowed (-1 is unlimited)"), cl::Hidden,
  80. cl::init(20), cl::cat(PollyCategory));
  81. static cl::opt<int> MaxCoefficient(
  82. "polly-opt-max-coefficient",
  83. cl::desc("The maximal coefficient allowed (-1 is unlimited)"), cl::Hidden,
  84. cl::init(20), cl::cat(PollyCategory));
  85. static cl::opt<std::string>
  86. MaximizeBandDepth("polly-opt-maximize-bands",
  87. cl::desc("Maximize the band depth (yes/no)"), cl::Hidden,
  88. cl::init("yes"), cl::cat(PollyCategory));
  89. static cl::opt<bool>
  90. GreedyFusion("polly-loopfusion-greedy",
  91. cl::desc("Aggressively try to fuse everything"), cl::Hidden,
  92. cl::cat(PollyCategory));
  93. static cl::opt<std::string> OuterCoincidence(
  94. "polly-opt-outer-coincidence",
  95. cl::desc("Try to construct schedules where the outer member of each band "
  96. "satisfies the coincidence constraints (yes/no)"),
  97. cl::Hidden, cl::init("no"), cl::cat(PollyCategory));
  98. static cl::opt<int> PrevectorWidth(
  99. "polly-prevect-width",
  100. cl::desc(
  101. "The number of loop iterations to strip-mine for pre-vectorization"),
  102. cl::Hidden, cl::init(4), cl::cat(PollyCategory));
  103. static cl::opt<bool> FirstLevelTiling("polly-tiling",
  104. cl::desc("Enable loop tiling"),
  105. cl::init(true), cl::cat(PollyCategory));
  106. static cl::opt<int> FirstLevelDefaultTileSize(
  107. "polly-default-tile-size",
  108. cl::desc("The default tile size (if not enough were provided by"
  109. " --polly-tile-sizes)"),
  110. cl::Hidden, cl::init(32), cl::cat(PollyCategory));
  111. static cl::list<int>
  112. FirstLevelTileSizes("polly-tile-sizes",
  113. cl::desc("A tile size for each loop dimension, filled "
  114. "with --polly-default-tile-size"),
  115. cl::Hidden, cl::CommaSeparated, cl::cat(PollyCategory));
  116. static cl::opt<bool>
  117. SecondLevelTiling("polly-2nd-level-tiling",
  118. cl::desc("Enable a 2nd level loop of loop tiling"),
  119. cl::cat(PollyCategory));
  120. static cl::opt<int> SecondLevelDefaultTileSize(
  121. "polly-2nd-level-default-tile-size",
  122. cl::desc("The default 2nd-level tile size (if not enough were provided by"
  123. " --polly-2nd-level-tile-sizes)"),
  124. cl::Hidden, cl::init(16), cl::cat(PollyCategory));
  125. static cl::list<int>
  126. SecondLevelTileSizes("polly-2nd-level-tile-sizes",
  127. cl::desc("A tile size for each loop dimension, filled "
  128. "with --polly-default-tile-size"),
  129. cl::Hidden, cl::CommaSeparated,
  130. cl::cat(PollyCategory));
  131. static cl::opt<bool> RegisterTiling("polly-register-tiling",
  132. cl::desc("Enable register tiling"),
  133. cl::cat(PollyCategory));
  134. static cl::opt<int> RegisterDefaultTileSize(
  135. "polly-register-tiling-default-tile-size",
  136. cl::desc("The default register tile size (if not enough were provided by"
  137. " --polly-register-tile-sizes)"),
  138. cl::Hidden, cl::init(2), cl::cat(PollyCategory));
  139. static cl::list<int>
  140. RegisterTileSizes("polly-register-tile-sizes",
  141. cl::desc("A tile size for each loop dimension, filled "
  142. "with --polly-register-tile-size"),
  143. cl::Hidden, cl::CommaSeparated, cl::cat(PollyCategory));
  144. static cl::opt<bool> PragmaBasedOpts(
  145. "polly-pragma-based-opts",
  146. cl::desc("Apply user-directed transformation from metadata"),
  147. cl::init(true), cl::cat(PollyCategory));
  148. static cl::opt<bool> EnableReschedule("polly-reschedule",
  149. cl::desc("Optimize SCoPs using ISL"),
  150. cl::init(true), cl::cat(PollyCategory));
  151. static cl::opt<bool>
  152. PMBasedOpts("polly-pattern-matching-based-opts",
  153. cl::desc("Perform optimizations based on pattern matching"),
  154. cl::init(true), cl::cat(PollyCategory));
  155. static cl::opt<bool>
  156. EnablePostopts("polly-postopts",
  157. cl::desc("Apply post-rescheduling optimizations such as "
  158. "tiling (requires -polly-reschedule)"),
  159. cl::init(true), cl::cat(PollyCategory));
  160. static cl::opt<bool> OptimizedScops(
  161. "polly-optimized-scops",
  162. cl::desc("Polly - Dump polyhedral description of Scops optimized with "
  163. "the isl scheduling optimizer and the set of post-scheduling "
  164. "transformations is applied on the schedule tree"),
  165. cl::cat(PollyCategory));
  166. STATISTIC(ScopsProcessed, "Number of scops processed");
  167. STATISTIC(ScopsRescheduled, "Number of scops rescheduled");
  168. STATISTIC(ScopsOptimized, "Number of scops optimized");
  169. STATISTIC(NumAffineLoopsOptimized, "Number of affine loops optimized");
  170. STATISTIC(NumBoxedLoopsOptimized, "Number of boxed loops optimized");
  171. #define THREE_STATISTICS(VARNAME, DESC) \
  172. static Statistic VARNAME[3] = { \
  173. {DEBUG_TYPE, #VARNAME "0", DESC " (original)"}, \
  174. {DEBUG_TYPE, #VARNAME "1", DESC " (after scheduler)"}, \
  175. {DEBUG_TYPE, #VARNAME "2", DESC " (after optimizer)"}}
  176. THREE_STATISTICS(NumBands, "Number of bands");
  177. THREE_STATISTICS(NumBandMembers, "Number of band members");
  178. THREE_STATISTICS(NumCoincident, "Number of coincident band members");
  179. THREE_STATISTICS(NumPermutable, "Number of permutable bands");
  180. THREE_STATISTICS(NumFilters, "Number of filter nodes");
  181. THREE_STATISTICS(NumExtension, "Number of extension nodes");
  182. STATISTIC(FirstLevelTileOpts, "Number of first level tiling applied");
  183. STATISTIC(SecondLevelTileOpts, "Number of second level tiling applied");
  184. STATISTIC(RegisterTileOpts, "Number of register tiling applied");
  185. STATISTIC(PrevectOpts, "Number of strip-mining for prevectorization applied");
  186. STATISTIC(MatMulOpts,
  187. "Number of matrix multiplication patterns detected and optimized");
  188. namespace {
  189. /// Additional parameters of the schedule optimizer.
  190. ///
  191. /// Target Transform Info and the SCoP dependencies used by the schedule
  192. /// optimizer.
  193. struct OptimizerAdditionalInfoTy {
  194. const llvm::TargetTransformInfo *TTI;
  195. const Dependences *D;
  196. bool PatternOpts;
  197. bool Postopts;
  198. bool Prevect;
  199. bool &DepsChanged;
  200. };
  201. class ScheduleTreeOptimizer final {
  202. public:
  203. /// Apply schedule tree transformations.
  204. ///
  205. /// This function takes an (possibly already optimized) schedule tree and
  206. /// applies a set of additional optimizations on the schedule tree. The
  207. /// transformations applied include:
  208. ///
  209. /// - Pattern-based optimizations
  210. /// - Tiling
  211. /// - Prevectorization
  212. ///
  213. /// @param Schedule The schedule object the transformations will be applied
  214. /// to.
  215. /// @param OAI Target Transform Info and the SCoP dependencies.
  216. /// @returns The transformed schedule.
  217. static isl::schedule
  218. optimizeSchedule(isl::schedule Schedule,
  219. const OptimizerAdditionalInfoTy *OAI = nullptr);
  220. /// Apply schedule tree transformations.
  221. ///
  222. /// This function takes a node in an (possibly already optimized) schedule
  223. /// tree and applies a set of additional optimizations on this schedule tree
  224. /// node and its descendants. The transformations applied include:
  225. ///
  226. /// - Pattern-based optimizations
  227. /// - Tiling
  228. /// - Prevectorization
  229. ///
  230. /// @param Node The schedule object post-transformations will be applied to.
  231. /// @param OAI Target Transform Info and the SCoP dependencies.
  232. /// @returns The transformed schedule.
  233. static isl::schedule_node
  234. optimizeScheduleNode(isl::schedule_node Node,
  235. const OptimizerAdditionalInfoTy *OAI = nullptr);
  236. /// Decide if the @p NewSchedule is profitable for @p S.
  237. ///
  238. /// @param S The SCoP we optimize.
  239. /// @param NewSchedule The new schedule we computed.
  240. ///
  241. /// @return True, if we believe @p NewSchedule is an improvement for @p S.
  242. static bool isProfitableSchedule(polly::Scop &S, isl::schedule NewSchedule);
  243. /// Isolate a set of partial tile prefixes.
  244. ///
  245. /// This set should ensure that it contains only partial tile prefixes that
  246. /// have exactly VectorWidth iterations.
  247. ///
  248. /// @param Node A schedule node band, which is a parent of a band node,
  249. /// that contains a vector loop.
  250. /// @return Modified isl_schedule_node.
  251. static isl::schedule_node isolateFullPartialTiles(isl::schedule_node Node,
  252. int VectorWidth);
  253. private:
  254. /// Check if this node is a band node we want to tile.
  255. ///
  256. /// We look for innermost band nodes where individual dimensions are marked as
  257. /// permutable.
  258. ///
  259. /// @param Node The node to check.
  260. static bool isTileableBandNode(isl::schedule_node Node);
  261. /// Check if this node is a band node we want to transform using pattern
  262. /// matching.
  263. ///
  264. /// We look for innermost band nodes where individual dimensions are marked as
  265. /// permutable. There is no restriction on the number of individual
  266. /// dimensions.
  267. ///
  268. /// @param Node The node to check.
  269. static bool isPMOptimizableBandNode(isl::schedule_node Node);
  270. /// Pre-vectorizes one scheduling dimension of a schedule band.
  271. ///
  272. /// prevectSchedBand splits out the dimension DimToVectorize, tiles it and
  273. /// sinks the resulting point loop.
  274. ///
  275. /// Example (DimToVectorize=0, VectorWidth=4):
  276. ///
  277. /// | Before transformation:
  278. /// |
  279. /// | A[i,j] -> [i,j]
  280. /// |
  281. /// | for (i = 0; i < 128; i++)
  282. /// | for (j = 0; j < 128; j++)
  283. /// | A(i,j);
  284. ///
  285. /// | After transformation:
  286. /// |
  287. /// | for (it = 0; it < 32; it+=1)
  288. /// | for (j = 0; j < 128; j++)
  289. /// | for (ip = 0; ip <= 3; ip++)
  290. /// | A(4 * it + ip,j);
  291. ///
  292. /// The goal of this transformation is to create a trivially vectorizable
  293. /// loop. This means a parallel loop at the innermost level that has a
  294. /// constant number of iterations corresponding to the target vector width.
  295. ///
  296. /// This transformation creates a loop at the innermost level. The loop has
  297. /// a constant number of iterations, if the number of loop iterations at
  298. /// DimToVectorize can be divided by VectorWidth. The default VectorWidth is
  299. /// currently constant and not yet target specific. This function does not
  300. /// reason about parallelism.
  301. static isl::schedule_node prevectSchedBand(isl::schedule_node Node,
  302. unsigned DimToVectorize,
  303. int VectorWidth);
  304. /// Apply additional optimizations on the bands in the schedule tree.
  305. ///
  306. /// We are looking for an innermost band node and apply the following
  307. /// transformations:
  308. ///
  309. /// - Tile the band
  310. /// - if the band is tileable
  311. /// - if the band has more than one loop dimension
  312. ///
  313. /// - Prevectorize the schedule of the band (or the point loop in case of
  314. /// tiling).
  315. /// - if vectorization is enabled
  316. ///
  317. /// @param Node The schedule node to (possibly) optimize.
  318. /// @param User A pointer to forward some use information
  319. /// (currently unused).
  320. static isl_schedule_node *optimizeBand(isl_schedule_node *Node, void *User);
  321. /// Apply tiling optimizations on the bands in the schedule tree.
  322. ///
  323. /// @param Node The schedule node to (possibly) optimize.
  324. static isl::schedule_node applyTileBandOpt(isl::schedule_node Node);
  325. /// Apply prevectorization on the bands in the schedule tree.
  326. ///
  327. /// @param Node The schedule node to (possibly) prevectorize.
  328. static isl::schedule_node applyPrevectBandOpt(isl::schedule_node Node);
  329. };
  330. isl::schedule_node
  331. ScheduleTreeOptimizer::isolateFullPartialTiles(isl::schedule_node Node,
  332. int VectorWidth) {
  333. assert(isl_schedule_node_get_type(Node.get()) == isl_schedule_node_band);
  334. Node = Node.child(0).child(0);
  335. isl::union_map SchedRelUMap = Node.get_prefix_schedule_relation();
  336. isl::union_set ScheduleRangeUSet = SchedRelUMap.range();
  337. isl::set ScheduleRange{ScheduleRangeUSet};
  338. isl::set IsolateDomain = getPartialTilePrefixes(ScheduleRange, VectorWidth);
  339. auto AtomicOption = getDimOptions(IsolateDomain.ctx(), "atomic");
  340. isl::union_set IsolateOption = getIsolateOptions(IsolateDomain, 1);
  341. Node = Node.parent().parent();
  342. isl::union_set Options = IsolateOption.unite(AtomicOption);
  343. isl::schedule_node_band Result =
  344. Node.as<isl::schedule_node_band>().set_ast_build_options(Options);
  345. return Result;
  346. }
  347. struct InsertSimdMarkers final : ScheduleNodeRewriter<InsertSimdMarkers> {
  348. isl::schedule_node visitBand(isl::schedule_node_band Band) {
  349. isl::schedule_node Node = visitChildren(Band);
  350. // Only add SIMD markers to innermost bands.
  351. if (!Node.first_child().isa<isl::schedule_node_leaf>())
  352. return Node;
  353. isl::id LoopMarker = isl::id::alloc(Band.ctx(), "SIMD", nullptr);
  354. return Band.insert_mark(LoopMarker);
  355. }
  356. };
  357. isl::schedule_node ScheduleTreeOptimizer::prevectSchedBand(
  358. isl::schedule_node Node, unsigned DimToVectorize, int VectorWidth) {
  359. assert(isl_schedule_node_get_type(Node.get()) == isl_schedule_node_band);
  360. auto Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
  361. unsigned ScheduleDimensions = unsignedFromIslSize(Space.dim(isl::dim::set));
  362. assert(DimToVectorize < ScheduleDimensions);
  363. if (DimToVectorize > 0) {
  364. Node = isl::manage(
  365. isl_schedule_node_band_split(Node.release(), DimToVectorize));
  366. Node = Node.child(0);
  367. }
  368. if (DimToVectorize < ScheduleDimensions - 1)
  369. Node = isl::manage(isl_schedule_node_band_split(Node.release(), 1));
  370. Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
  371. auto Sizes = isl::multi_val::zero(Space);
  372. Sizes = Sizes.set_val(0, isl::val(Node.ctx(), VectorWidth));
  373. Node =
  374. isl::manage(isl_schedule_node_band_tile(Node.release(), Sizes.release()));
  375. Node = isolateFullPartialTiles(Node, VectorWidth);
  376. Node = Node.child(0);
  377. // Make sure the "trivially vectorizable loop" is not unrolled. Otherwise,
  378. // we will have troubles to match it in the backend.
  379. Node = Node.as<isl::schedule_node_band>().set_ast_build_options(
  380. isl::union_set(Node.ctx(), "{ unroll[x]: 1 = 0 }"));
  381. // Sink the inner loop into the smallest possible statements to make them
  382. // represent a single vector instruction if possible.
  383. Node = isl::manage(isl_schedule_node_band_sink(Node.release()));
  384. // Add SIMD markers to those vector statements.
  385. InsertSimdMarkers SimdMarkerInserter;
  386. Node = SimdMarkerInserter.visit(Node);
  387. PrevectOpts++;
  388. return Node.parent();
  389. }
  390. static bool isSimpleInnermostBand(const isl::schedule_node &Node) {
  391. assert(isl_schedule_node_get_type(Node.get()) == isl_schedule_node_band);
  392. assert(isl_schedule_node_n_children(Node.get()) == 1);
  393. auto ChildType = isl_schedule_node_get_type(Node.child(0).get());
  394. if (ChildType == isl_schedule_node_leaf)
  395. return true;
  396. if (ChildType != isl_schedule_node_sequence)
  397. return false;
  398. auto Sequence = Node.child(0);
  399. for (int c = 0, nc = isl_schedule_node_n_children(Sequence.get()); c < nc;
  400. ++c) {
  401. auto Child = Sequence.child(c);
  402. if (isl_schedule_node_get_type(Child.get()) != isl_schedule_node_filter)
  403. return false;
  404. if (isl_schedule_node_get_type(Child.child(0).get()) !=
  405. isl_schedule_node_leaf)
  406. return false;
  407. }
  408. return true;
  409. }
  410. /// Check if this node is a band node, which has only one child.
  411. ///
  412. /// @param Node The node to check.
  413. static bool isOneTimeParentBandNode(isl::schedule_node Node) {
  414. if (isl_schedule_node_get_type(Node.get()) != isl_schedule_node_band)
  415. return false;
  416. if (isl_schedule_node_n_children(Node.get()) != 1)
  417. return false;
  418. return true;
  419. }
  420. bool ScheduleTreeOptimizer::isTileableBandNode(isl::schedule_node Node) {
  421. if (!isOneTimeParentBandNode(Node))
  422. return false;
  423. if (!isl_schedule_node_band_get_permutable(Node.get()))
  424. return false;
  425. auto Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
  426. if (unsignedFromIslSize(Space.dim(isl::dim::set)) <= 1u)
  427. return false;
  428. return isSimpleInnermostBand(Node);
  429. }
  430. bool ScheduleTreeOptimizer::isPMOptimizableBandNode(isl::schedule_node Node) {
  431. if (!isOneTimeParentBandNode(Node))
  432. return false;
  433. return Node.child(0).isa<isl::schedule_node_leaf>();
  434. }
  435. __isl_give isl::schedule_node
  436. ScheduleTreeOptimizer::applyTileBandOpt(isl::schedule_node Node) {
  437. if (FirstLevelTiling) {
  438. Node = tileNode(Node, "1st level tiling", FirstLevelTileSizes,
  439. FirstLevelDefaultTileSize);
  440. FirstLevelTileOpts++;
  441. }
  442. if (SecondLevelTiling) {
  443. Node = tileNode(Node, "2nd level tiling", SecondLevelTileSizes,
  444. SecondLevelDefaultTileSize);
  445. SecondLevelTileOpts++;
  446. }
  447. if (RegisterTiling) {
  448. Node =
  449. applyRegisterTiling(Node, RegisterTileSizes, RegisterDefaultTileSize);
  450. RegisterTileOpts++;
  451. }
  452. return Node;
  453. }
  454. isl::schedule_node
  455. ScheduleTreeOptimizer::applyPrevectBandOpt(isl::schedule_node Node) {
  456. auto Space = isl::manage(isl_schedule_node_band_get_space(Node.get()));
  457. int Dims = unsignedFromIslSize(Space.dim(isl::dim::set));
  458. for (int i = Dims - 1; i >= 0; i--)
  459. if (Node.as<isl::schedule_node_band>().member_get_coincident(i)) {
  460. Node = prevectSchedBand(Node, i, PrevectorWidth);
  461. break;
  462. }
  463. return Node;
  464. }
  465. __isl_give isl_schedule_node *
  466. ScheduleTreeOptimizer::optimizeBand(__isl_take isl_schedule_node *NodeArg,
  467. void *User) {
  468. const OptimizerAdditionalInfoTy *OAI =
  469. static_cast<const OptimizerAdditionalInfoTy *>(User);
  470. assert(OAI && "Expecting optimization options");
  471. isl::schedule_node Node = isl::manage(NodeArg);
  472. if (OAI->PatternOpts && isPMOptimizableBandNode(Node)) {
  473. isl::schedule_node PatternOptimizedSchedule =
  474. tryOptimizeMatMulPattern(Node, OAI->TTI, OAI->D);
  475. if (!PatternOptimizedSchedule.is_null()) {
  476. MatMulOpts++;
  477. OAI->DepsChanged = true;
  478. return PatternOptimizedSchedule.release();
  479. }
  480. }
  481. if (!isTileableBandNode(Node))
  482. return Node.release();
  483. if (OAI->Postopts)
  484. Node = applyTileBandOpt(Node);
  485. if (OAI->Prevect) {
  486. // FIXME: Prevectorization requirements are different from those checked by
  487. // isTileableBandNode.
  488. Node = applyPrevectBandOpt(Node);
  489. }
  490. return Node.release();
  491. }
  492. isl::schedule
  493. ScheduleTreeOptimizer::optimizeSchedule(isl::schedule Schedule,
  494. const OptimizerAdditionalInfoTy *OAI) {
  495. auto Root = Schedule.get_root();
  496. Root = optimizeScheduleNode(Root, OAI);
  497. return Root.get_schedule();
  498. }
  499. isl::schedule_node ScheduleTreeOptimizer::optimizeScheduleNode(
  500. isl::schedule_node Node, const OptimizerAdditionalInfoTy *OAI) {
  501. Node = isl::manage(isl_schedule_node_map_descendant_bottom_up(
  502. Node.release(), optimizeBand,
  503. const_cast<void *>(static_cast<const void *>(OAI))));
  504. return Node;
  505. }
  506. bool ScheduleTreeOptimizer::isProfitableSchedule(Scop &S,
  507. isl::schedule NewSchedule) {
  508. // To understand if the schedule has been optimized we check if the schedule
  509. // has changed at all.
  510. // TODO: We can improve this by tracking if any necessarily beneficial
  511. // transformations have been performed. This can e.g. be tiling, loop
  512. // interchange, or ...) We can track this either at the place where the
  513. // transformation has been performed or, in case of automatic ILP based
  514. // optimizations, by comparing (yet to be defined) performance metrics
  515. // before/after the scheduling optimizer
  516. // (e.g., #stride-one accesses)
  517. // FIXME: A schedule tree whose union_map-conversion is identical to the
  518. // original schedule map may still allow for parallelization, i.e. can still
  519. // be profitable.
  520. auto NewScheduleMap = NewSchedule.get_map();
  521. auto OldSchedule = S.getSchedule();
  522. assert(!OldSchedule.is_null() &&
  523. "Only IslScheduleOptimizer can insert extension nodes "
  524. "that make Scop::getSchedule() return nullptr.");
  525. bool changed = !OldSchedule.is_equal(NewScheduleMap);
  526. return changed;
  527. }
  528. class IslScheduleOptimizerWrapperPass final : public ScopPass {
  529. public:
  530. static char ID;
  531. explicit IslScheduleOptimizerWrapperPass() : ScopPass(ID) {}
  532. /// Optimize the schedule of the SCoP @p S.
  533. bool runOnScop(Scop &S) override;
  534. /// Print the new schedule for the SCoP @p S.
  535. void printScop(raw_ostream &OS, Scop &S) const override;
  536. /// Register all analyses and transformation required.
  537. void getAnalysisUsage(AnalysisUsage &AU) const override;
  538. /// Release the internal memory.
  539. void releaseMemory() override {
  540. LastSchedule = {};
  541. IslCtx.reset();
  542. }
  543. private:
  544. std::shared_ptr<isl_ctx> IslCtx;
  545. isl::schedule LastSchedule;
  546. };
  547. char IslScheduleOptimizerWrapperPass::ID = 0;
  548. #ifndef NDEBUG
  549. static void printSchedule(llvm::raw_ostream &OS, const isl::schedule &Schedule,
  550. StringRef Desc) {
  551. isl::ctx Ctx = Schedule.ctx();
  552. isl_printer *P = isl_printer_to_str(Ctx.get());
  553. P = isl_printer_set_yaml_style(P, ISL_YAML_STYLE_BLOCK);
  554. P = isl_printer_print_schedule(P, Schedule.get());
  555. char *Str = isl_printer_get_str(P);
  556. OS << Desc << ": \n" << Str << "\n";
  557. free(Str);
  558. isl_printer_free(P);
  559. }
  560. #endif
  561. /// Collect statistics for the schedule tree.
  562. ///
  563. /// @param Schedule The schedule tree to analyze. If not a schedule tree it is
  564. /// ignored.
  565. /// @param Version The version of the schedule tree that is analyzed.
  566. /// 0 for the original schedule tree before any transformation.
  567. /// 1 for the schedule tree after isl's rescheduling.
  568. /// 2 for the schedule tree after optimizations are applied
  569. /// (tiling, pattern matching)
  570. static void walkScheduleTreeForStatistics(isl::schedule Schedule, int Version) {
  571. auto Root = Schedule.get_root();
  572. if (Root.is_null())
  573. return;
  574. isl_schedule_node_foreach_descendant_top_down(
  575. Root.get(),
  576. [](__isl_keep isl_schedule_node *nodeptr, void *user) -> isl_bool {
  577. isl::schedule_node Node = isl::manage_copy(nodeptr);
  578. int Version = *static_cast<int *>(user);
  579. switch (isl_schedule_node_get_type(Node.get())) {
  580. case isl_schedule_node_band: {
  581. NumBands[Version]++;
  582. if (isl_schedule_node_band_get_permutable(Node.get()) ==
  583. isl_bool_true)
  584. NumPermutable[Version]++;
  585. int CountMembers = isl_schedule_node_band_n_member(Node.get());
  586. NumBandMembers[Version] += CountMembers;
  587. for (int i = 0; i < CountMembers; i += 1) {
  588. if (Node.as<isl::schedule_node_band>().member_get_coincident(i))
  589. NumCoincident[Version]++;
  590. }
  591. break;
  592. }
  593. case isl_schedule_node_filter:
  594. NumFilters[Version]++;
  595. break;
  596. case isl_schedule_node_extension:
  597. NumExtension[Version]++;
  598. break;
  599. default:
  600. break;
  601. }
  602. return isl_bool_true;
  603. },
  604. &Version);
  605. }
  606. static void runIslScheduleOptimizer(
  607. Scop &S,
  608. function_ref<const Dependences &(Dependences::AnalysisLevel)> GetDeps,
  609. TargetTransformInfo *TTI, OptimizationRemarkEmitter *ORE,
  610. isl::schedule &LastSchedule, bool &DepsChanged) {
  611. // Skip SCoPs in case they're already optimised by PPCGCodeGeneration
  612. if (S.isToBeSkipped())
  613. return;
  614. // Skip empty SCoPs but still allow code generation as it will delete the
  615. // loops present but not needed.
  616. if (S.getSize() == 0) {
  617. S.markAsOptimized();
  618. return;
  619. }
  620. ScopsProcessed++;
  621. // Schedule without optimizations.
  622. isl::schedule Schedule = S.getScheduleTree();
  623. walkScheduleTreeForStatistics(S.getScheduleTree(), 0);
  624. LLVM_DEBUG(printSchedule(dbgs(), Schedule, "Original schedule tree"));
  625. bool HasUserTransformation = false;
  626. if (PragmaBasedOpts) {
  627. isl::schedule ManuallyTransformed = applyManualTransformations(
  628. &S, Schedule, GetDeps(Dependences::AL_Statement), ORE);
  629. if (ManuallyTransformed.is_null()) {
  630. LLVM_DEBUG(dbgs() << "Error during manual optimization\n");
  631. return;
  632. }
  633. if (ManuallyTransformed.get() != Schedule.get()) {
  634. // User transformations have precedence over other transformations.
  635. HasUserTransformation = true;
  636. Schedule = std::move(ManuallyTransformed);
  637. LLVM_DEBUG(
  638. printSchedule(dbgs(), Schedule, "After manual transformations"));
  639. }
  640. }
  641. // Only continue if either manual transformations have been applied or we are
  642. // allowed to apply heuristics.
  643. // TODO: Detect disabled heuristics and no user-directed transformation
  644. // metadata earlier in ScopDetection.
  645. if (!HasUserTransformation && S.hasDisableHeuristicsHint()) {
  646. LLVM_DEBUG(dbgs() << "Heuristic optimizations disabled by metadata\n");
  647. return;
  648. }
  649. // Get dependency analysis.
  650. const Dependences &D = GetDeps(Dependences::AL_Statement);
  651. if (D.getSharedIslCtx() != S.getSharedIslCtx()) {
  652. LLVM_DEBUG(dbgs() << "DependenceInfo for another SCoP/isl_ctx\n");
  653. return;
  654. }
  655. if (!D.hasValidDependences()) {
  656. LLVM_DEBUG(dbgs() << "Dependency information not available\n");
  657. return;
  658. }
  659. // Apply ISL's algorithm only if not overriden by the user. Note that
  660. // post-rescheduling optimizations (tiling, pattern-based, prevectorization)
  661. // rely on the coincidence/permutable annotations on schedule tree bands that
  662. // are added by the rescheduling analyzer. Therefore, disabling the
  663. // rescheduler implicitly also disables these optimizations.
  664. if (!EnableReschedule) {
  665. LLVM_DEBUG(dbgs() << "Skipping rescheduling due to command line option\n");
  666. } else if (HasUserTransformation) {
  667. LLVM_DEBUG(
  668. dbgs() << "Skipping rescheduling due to manual transformation\n");
  669. } else {
  670. // Build input data.
  671. int ValidityKinds =
  672. Dependences::TYPE_RAW | Dependences::TYPE_WAR | Dependences::TYPE_WAW;
  673. int ProximityKinds;
  674. if (OptimizeDeps == "all")
  675. ProximityKinds =
  676. Dependences::TYPE_RAW | Dependences::TYPE_WAR | Dependences::TYPE_WAW;
  677. else if (OptimizeDeps == "raw")
  678. ProximityKinds = Dependences::TYPE_RAW;
  679. else {
  680. errs() << "Do not know how to optimize for '" << OptimizeDeps << "'"
  681. << " Falling back to optimizing all dependences.\n";
  682. ProximityKinds =
  683. Dependences::TYPE_RAW | Dependences::TYPE_WAR | Dependences::TYPE_WAW;
  684. }
  685. isl::union_set Domain = S.getDomains();
  686. if (Domain.is_null())
  687. return;
  688. isl::union_map Validity = D.getDependences(ValidityKinds);
  689. isl::union_map Proximity = D.getDependences(ProximityKinds);
  690. // Simplify the dependences by removing the constraints introduced by the
  691. // domains. This can speed up the scheduling time significantly, as large
  692. // constant coefficients will be removed from the dependences. The
  693. // introduction of some additional dependences reduces the possible
  694. // transformations, but in most cases, such transformation do not seem to be
  695. // interesting anyway. In some cases this option may stop the scheduler to
  696. // find any schedule.
  697. if (SimplifyDeps == "yes") {
  698. Validity = Validity.gist_domain(Domain);
  699. Validity = Validity.gist_range(Domain);
  700. Proximity = Proximity.gist_domain(Domain);
  701. Proximity = Proximity.gist_range(Domain);
  702. } else if (SimplifyDeps != "no") {
  703. errs()
  704. << "warning: Option -polly-opt-simplify-deps should either be 'yes' "
  705. "or 'no'. Falling back to default: 'yes'\n";
  706. }
  707. LLVM_DEBUG(dbgs() << "\n\nCompute schedule from: ");
  708. LLVM_DEBUG(dbgs() << "Domain := " << Domain << ";\n");
  709. LLVM_DEBUG(dbgs() << "Proximity := " << Proximity << ";\n");
  710. LLVM_DEBUG(dbgs() << "Validity := " << Validity << ";\n");
  711. int IslMaximizeBands;
  712. if (MaximizeBandDepth == "yes") {
  713. IslMaximizeBands = 1;
  714. } else if (MaximizeBandDepth == "no") {
  715. IslMaximizeBands = 0;
  716. } else {
  717. errs()
  718. << "warning: Option -polly-opt-maximize-bands should either be 'yes'"
  719. " or 'no'. Falling back to default: 'yes'\n";
  720. IslMaximizeBands = 1;
  721. }
  722. int IslOuterCoincidence;
  723. if (OuterCoincidence == "yes") {
  724. IslOuterCoincidence = 1;
  725. } else if (OuterCoincidence == "no") {
  726. IslOuterCoincidence = 0;
  727. } else {
  728. errs() << "warning: Option -polly-opt-outer-coincidence should either be "
  729. "'yes' or 'no'. Falling back to default: 'no'\n";
  730. IslOuterCoincidence = 0;
  731. }
  732. isl_ctx *Ctx = S.getIslCtx().get();
  733. isl_options_set_schedule_outer_coincidence(Ctx, IslOuterCoincidence);
  734. isl_options_set_schedule_maximize_band_depth(Ctx, IslMaximizeBands);
  735. isl_options_set_schedule_max_constant_term(Ctx, MaxConstantTerm);
  736. isl_options_set_schedule_max_coefficient(Ctx, MaxCoefficient);
  737. isl_options_set_tile_scale_tile_loops(Ctx, 0);
  738. auto OnErrorStatus = isl_options_get_on_error(Ctx);
  739. isl_options_set_on_error(Ctx, ISL_ON_ERROR_CONTINUE);
  740. auto SC = isl::schedule_constraints::on_domain(Domain);
  741. SC = SC.set_proximity(Proximity);
  742. SC = SC.set_validity(Validity);
  743. SC = SC.set_coincidence(Validity);
  744. Schedule = SC.compute_schedule();
  745. isl_options_set_on_error(Ctx, OnErrorStatus);
  746. ScopsRescheduled++;
  747. LLVM_DEBUG(printSchedule(dbgs(), Schedule, "After rescheduling"));
  748. }
  749. walkScheduleTreeForStatistics(Schedule, 1);
  750. // In cases the scheduler is not able to optimize the code, we just do not
  751. // touch the schedule.
  752. if (Schedule.is_null())
  753. return;
  754. if (GreedyFusion) {
  755. isl::union_map Validity = D.getDependences(
  756. Dependences::TYPE_RAW | Dependences::TYPE_WAR | Dependences::TYPE_WAW);
  757. Schedule = applyGreedyFusion(Schedule, Validity);
  758. assert(!Schedule.is_null());
  759. }
  760. // Apply post-rescheduling optimizations (if enabled) and/or prevectorization.
  761. const OptimizerAdditionalInfoTy OAI = {
  762. TTI,
  763. const_cast<Dependences *>(&D),
  764. /*PatternOpts=*/!HasUserTransformation && PMBasedOpts,
  765. /*Postopts=*/!HasUserTransformation && EnablePostopts,
  766. /*Prevect=*/PollyVectorizerChoice != VECTORIZER_NONE,
  767. DepsChanged};
  768. if (OAI.PatternOpts || OAI.Postopts || OAI.Prevect) {
  769. Schedule = ScheduleTreeOptimizer::optimizeSchedule(Schedule, &OAI);
  770. Schedule = hoistExtensionNodes(Schedule);
  771. LLVM_DEBUG(printSchedule(dbgs(), Schedule, "After post-optimizations"));
  772. walkScheduleTreeForStatistics(Schedule, 2);
  773. }
  774. // Skip profitability check if user transformation(s) have been applied.
  775. if (!HasUserTransformation &&
  776. !ScheduleTreeOptimizer::isProfitableSchedule(S, Schedule))
  777. return;
  778. auto ScopStats = S.getStatistics();
  779. ScopsOptimized++;
  780. NumAffineLoopsOptimized += ScopStats.NumAffineLoops;
  781. NumBoxedLoopsOptimized += ScopStats.NumBoxedLoops;
  782. LastSchedule = Schedule;
  783. S.setScheduleTree(Schedule);
  784. S.markAsOptimized();
  785. if (OptimizedScops)
  786. errs() << S;
  787. }
  788. bool IslScheduleOptimizerWrapperPass::runOnScop(Scop &S) {
  789. releaseMemory();
  790. Function &F = S.getFunction();
  791. IslCtx = S.getSharedIslCtx();
  792. auto getDependences =
  793. [this](Dependences::AnalysisLevel) -> const Dependences & {
  794. return getAnalysis<DependenceInfo>().getDependences(
  795. Dependences::AL_Statement);
  796. };
  797. OptimizationRemarkEmitter &ORE =
  798. getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE();
  799. TargetTransformInfo *TTI =
  800. &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
  801. bool DepsChanged = false;
  802. runIslScheduleOptimizer(S, getDependences, TTI, &ORE, LastSchedule,
  803. DepsChanged);
  804. if (DepsChanged)
  805. getAnalysis<DependenceInfo>().abandonDependences();
  806. return false;
  807. }
  808. static void runScheduleOptimizerPrinter(raw_ostream &OS,
  809. isl::schedule LastSchedule) {
  810. isl_printer *p;
  811. char *ScheduleStr;
  812. OS << "Calculated schedule:\n";
  813. if (LastSchedule.is_null()) {
  814. OS << "n/a\n";
  815. return;
  816. }
  817. p = isl_printer_to_str(LastSchedule.ctx().get());
  818. p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_BLOCK);
  819. p = isl_printer_print_schedule(p, LastSchedule.get());
  820. ScheduleStr = isl_printer_get_str(p);
  821. isl_printer_free(p);
  822. OS << ScheduleStr << "\n";
  823. free(ScheduleStr);
  824. }
  825. void IslScheduleOptimizerWrapperPass::printScop(raw_ostream &OS, Scop &) const {
  826. runScheduleOptimizerPrinter(OS, LastSchedule);
  827. }
  828. void IslScheduleOptimizerWrapperPass::getAnalysisUsage(
  829. AnalysisUsage &AU) const {
  830. ScopPass::getAnalysisUsage(AU);
  831. AU.addRequired<DependenceInfo>();
  832. AU.addRequired<TargetTransformInfoWrapperPass>();
  833. AU.addRequired<OptimizationRemarkEmitterWrapperPass>();
  834. AU.addPreserved<DependenceInfo>();
  835. AU.addPreserved<OptimizationRemarkEmitterWrapperPass>();
  836. }
  837. } // namespace
  838. Pass *polly::createIslScheduleOptimizerWrapperPass() {
  839. return new IslScheduleOptimizerWrapperPass();
  840. }
  841. INITIALIZE_PASS_BEGIN(IslScheduleOptimizerWrapperPass, "polly-opt-isl",
  842. "Polly - Optimize schedule of SCoP", false, false);
  843. INITIALIZE_PASS_DEPENDENCY(DependenceInfo);
  844. INITIALIZE_PASS_DEPENDENCY(ScopInfoRegionPass);
  845. INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass);
  846. INITIALIZE_PASS_DEPENDENCY(OptimizationRemarkEmitterWrapperPass);
  847. INITIALIZE_PASS_END(IslScheduleOptimizerWrapperPass, "polly-opt-isl",
  848. "Polly - Optimize schedule of SCoP", false, false)
  849. static llvm::PreservedAnalyses
  850. runIslScheduleOptimizerUsingNPM(Scop &S, ScopAnalysisManager &SAM,
  851. ScopStandardAnalysisResults &SAR, SPMUpdater &U,
  852. raw_ostream *OS) {
  853. DependenceAnalysis::Result &Deps = SAM.getResult<DependenceAnalysis>(S, SAR);
  854. auto GetDeps = [&Deps](Dependences::AnalysisLevel) -> const Dependences & {
  855. return Deps.getDependences(Dependences::AL_Statement);
  856. };
  857. OptimizationRemarkEmitter ORE(&S.getFunction());
  858. TargetTransformInfo *TTI = &SAR.TTI;
  859. isl::schedule LastSchedule;
  860. bool DepsChanged = false;
  861. runIslScheduleOptimizer(S, GetDeps, TTI, &ORE, LastSchedule, DepsChanged);
  862. if (DepsChanged)
  863. Deps.abandonDependences();
  864. if (OS) {
  865. *OS << "Printing analysis 'Polly - Optimize schedule of SCoP' for region: '"
  866. << S.getName() << "' in function '" << S.getFunction().getName()
  867. << "':\n";
  868. runScheduleOptimizerPrinter(*OS, LastSchedule);
  869. }
  870. return PreservedAnalyses::all();
  871. }
  872. llvm::PreservedAnalyses
  873. IslScheduleOptimizerPass::run(Scop &S, ScopAnalysisManager &SAM,
  874. ScopStandardAnalysisResults &SAR, SPMUpdater &U) {
  875. return runIslScheduleOptimizerUsingNPM(S, SAM, SAR, U, nullptr);
  876. }
  877. llvm::PreservedAnalyses
  878. IslScheduleOptimizerPrinterPass::run(Scop &S, ScopAnalysisManager &SAM,
  879. ScopStandardAnalysisResults &SAR,
  880. SPMUpdater &U) {
  881. return runIslScheduleOptimizerUsingNPM(S, SAM, SAR, U, &OS);
  882. }
  883. //===----------------------------------------------------------------------===//
  884. namespace {
  885. /// Print result from IslScheduleOptimizerWrapperPass.
  886. class IslScheduleOptimizerPrinterLegacyPass final : public ScopPass {
  887. public:
  888. static char ID;
  889. IslScheduleOptimizerPrinterLegacyPass()
  890. : IslScheduleOptimizerPrinterLegacyPass(outs()) {}
  891. explicit IslScheduleOptimizerPrinterLegacyPass(llvm::raw_ostream &OS)
  892. : ScopPass(ID), OS(OS) {}
  893. bool runOnScop(Scop &S) override {
  894. IslScheduleOptimizerWrapperPass &P =
  895. getAnalysis<IslScheduleOptimizerWrapperPass>();
  896. OS << "Printing analysis '" << P.getPassName() << "' for region: '"
  897. << S.getRegion().getNameStr() << "' in function '"
  898. << S.getFunction().getName() << "':\n";
  899. P.printScop(OS, S);
  900. return false;
  901. }
  902. void getAnalysisUsage(AnalysisUsage &AU) const override {
  903. ScopPass::getAnalysisUsage(AU);
  904. AU.addRequired<IslScheduleOptimizerWrapperPass>();
  905. AU.setPreservesAll();
  906. }
  907. private:
  908. llvm::raw_ostream &OS;
  909. };
  910. char IslScheduleOptimizerPrinterLegacyPass::ID = 0;
  911. } // namespace
  912. Pass *polly::createIslScheduleOptimizerPrinterLegacyPass(raw_ostream &OS) {
  913. return new IslScheduleOptimizerPrinterLegacyPass(OS);
  914. }
  915. INITIALIZE_PASS_BEGIN(IslScheduleOptimizerPrinterLegacyPass,
  916. "polly-print-opt-isl",
  917. "Polly - Print optimizer schedule of SCoP", false, false);
  918. INITIALIZE_PASS_DEPENDENCY(IslScheduleOptimizerWrapperPass)
  919. INITIALIZE_PASS_END(IslScheduleOptimizerPrinterLegacyPass,
  920. "polly-print-opt-isl",
  921. "Polly - Print optimizer schedule of SCoP", false, false)