graphite-dependences.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /* Data dependence analysis for Graphite.
  2. Copyright (C) 2009-2015 Free Software Foundation, Inc.
  3. Contributed by Sebastian Pop <sebastian.pop@amd.com> and
  4. Konrad Trifunovic <konrad.trifunovic@inria.fr>.
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3, or (at your option)
  9. any later version.
  10. GCC is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. #include "config.h"
  18. #ifdef HAVE_isl
  19. #include <isl/set.h>
  20. #include <isl/map.h>
  21. #include <isl/union_map.h>
  22. #include <isl/flow.h>
  23. #include <isl/constraint.h>
  24. #endif
  25. #include "system.h"
  26. #include "coretypes.h"
  27. #include "hash-set.h"
  28. #include "machmode.h"
  29. #include "vec.h"
  30. #include "double-int.h"
  31. #include "input.h"
  32. #include "alias.h"
  33. #include "symtab.h"
  34. #include "options.h"
  35. #include "wide-int.h"
  36. #include "inchash.h"
  37. #include "tree.h"
  38. #include "fold-const.h"
  39. #include "predict.h"
  40. #include "tm.h"
  41. #include "hard-reg-set.h"
  42. #include "input.h"
  43. #include "function.h"
  44. #include "dominance.h"
  45. #include "cfg.h"
  46. #include "basic-block.h"
  47. #include "tree-ssa-alias.h"
  48. #include "internal-fn.h"
  49. #include "gimple-expr.h"
  50. #include "is-a.h"
  51. #include "gimple.h"
  52. #include "gimple-iterator.h"
  53. #include "tree-ssa-loop.h"
  54. #include "tree-pass.h"
  55. #include "cfgloop.h"
  56. #include "tree-chrec.h"
  57. #include "tree-data-ref.h"
  58. #include "tree-scalar-evolution.h"
  59. #include "sese.h"
  60. #ifdef HAVE_isl
  61. #include "graphite-poly.h"
  62. isl_union_map *
  63. scop_get_dependences (scop_p scop)
  64. {
  65. isl_union_map *dependences;
  66. if (!scop->must_raw)
  67. compute_deps (scop, SCOP_BBS (scop),
  68. &scop->must_raw, &scop->may_raw,
  69. &scop->must_raw_no_source, &scop->may_raw_no_source,
  70. &scop->must_war, &scop->may_war,
  71. &scop->must_war_no_source, &scop->may_war_no_source,
  72. &scop->must_waw, &scop->may_waw,
  73. &scop->must_waw_no_source, &scop->may_waw_no_source);
  74. dependences = isl_union_map_copy (scop->must_raw);
  75. dependences = isl_union_map_union (dependences,
  76. isl_union_map_copy (scop->must_war));
  77. dependences = isl_union_map_union (dependences,
  78. isl_union_map_copy (scop->must_waw));
  79. dependences = isl_union_map_union (dependences,
  80. isl_union_map_copy (scop->may_raw));
  81. dependences = isl_union_map_union (dependences,
  82. isl_union_map_copy (scop->may_war));
  83. dependences = isl_union_map_union (dependences,
  84. isl_union_map_copy (scop->may_waw));
  85. return dependences;
  86. }
  87. /* Add the constraints from the set S to the domain of MAP. */
  88. static isl_map *
  89. constrain_domain (isl_map *map, isl_set *s)
  90. {
  91. isl_space *d = isl_map_get_space (map);
  92. isl_id *id = isl_space_get_tuple_id (d, isl_dim_in);
  93. s = isl_set_set_tuple_id (s, id);
  94. isl_space_free (d);
  95. return isl_map_intersect_domain (map, s);
  96. }
  97. /* Constrain pdr->accesses with pdr->extent and pbb->domain. */
  98. static isl_map *
  99. add_pdr_constraints (poly_dr_p pdr, poly_bb_p pbb)
  100. {
  101. isl_map *x = isl_map_intersect_range (isl_map_copy (pdr->accesses),
  102. isl_set_copy (pdr->extent));
  103. x = constrain_domain (x, isl_set_copy (pbb->domain));
  104. return x;
  105. }
  106. /* Returns all the memory reads in SCOP. */
  107. static isl_union_map *
  108. scop_get_reads (scop_p scop, vec<poly_bb_p> pbbs)
  109. {
  110. int i, j;
  111. poly_bb_p pbb;
  112. poly_dr_p pdr;
  113. isl_space *space = isl_set_get_space (scop->context);
  114. isl_union_map *res = isl_union_map_empty (space);
  115. FOR_EACH_VEC_ELT (pbbs, i, pbb)
  116. {
  117. FOR_EACH_VEC_ELT (PBB_DRS (pbb), j, pdr)
  118. if (pdr_read_p (pdr))
  119. res = isl_union_map_add_map (res, add_pdr_constraints (pdr, pbb));
  120. }
  121. return res;
  122. }
  123. /* Returns all the memory must writes in SCOP. */
  124. static isl_union_map *
  125. scop_get_must_writes (scop_p scop, vec<poly_bb_p> pbbs)
  126. {
  127. int i, j;
  128. poly_bb_p pbb;
  129. poly_dr_p pdr;
  130. isl_space *space = isl_set_get_space (scop->context);
  131. isl_union_map *res = isl_union_map_empty (space);
  132. FOR_EACH_VEC_ELT (pbbs, i, pbb)
  133. {
  134. FOR_EACH_VEC_ELT (PBB_DRS (pbb), j, pdr)
  135. if (pdr_write_p (pdr))
  136. res = isl_union_map_add_map (res, add_pdr_constraints (pdr, pbb));
  137. }
  138. return res;
  139. }
  140. /* Returns all the memory may writes in SCOP. */
  141. static isl_union_map *
  142. scop_get_may_writes (scop_p scop, vec<poly_bb_p> pbbs)
  143. {
  144. int i, j;
  145. poly_bb_p pbb;
  146. poly_dr_p pdr;
  147. isl_space *space = isl_set_get_space (scop->context);
  148. isl_union_map *res = isl_union_map_empty (space);
  149. FOR_EACH_VEC_ELT (pbbs, i, pbb)
  150. {
  151. FOR_EACH_VEC_ELT (PBB_DRS (pbb), j, pdr)
  152. if (pdr_may_write_p (pdr))
  153. res = isl_union_map_add_map (res, add_pdr_constraints (pdr, pbb));
  154. }
  155. return res;
  156. }
  157. /* Returns all the original schedules in SCOP. */
  158. static isl_union_map *
  159. scop_get_original_schedule (scop_p scop, vec<poly_bb_p> pbbs)
  160. {
  161. int i;
  162. poly_bb_p pbb;
  163. isl_space *space = isl_set_get_space (scop->context);
  164. isl_union_map *res = isl_union_map_empty (space);
  165. FOR_EACH_VEC_ELT (pbbs, i, pbb)
  166. {
  167. res = isl_union_map_add_map
  168. (res, constrain_domain (isl_map_copy (pbb->schedule),
  169. isl_set_copy (pbb->domain)));
  170. }
  171. return res;
  172. }
  173. /* Returns all the transformed schedules in SCOP. */
  174. static isl_union_map *
  175. scop_get_transformed_schedule (scop_p scop, vec<poly_bb_p> pbbs)
  176. {
  177. int i;
  178. poly_bb_p pbb;
  179. isl_space *space = isl_set_get_space (scop->context);
  180. isl_union_map *res = isl_union_map_empty (space);
  181. FOR_EACH_VEC_ELT (pbbs, i, pbb)
  182. {
  183. res = isl_union_map_add_map
  184. (res, constrain_domain (isl_map_copy (pbb->transformed),
  185. isl_set_copy (pbb->domain)));
  186. }
  187. return res;
  188. }
  189. /* Helper function used on each MAP of a isl_union_map. Computes the
  190. maximal output dimension. */
  191. static int
  192. max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
  193. {
  194. int global_max = *((int *) user);
  195. isl_space *space = isl_map_get_space (map);
  196. int nb_out = isl_space_dim (space, isl_dim_out);
  197. if (global_max < nb_out)
  198. *((int *) user) = nb_out;
  199. isl_map_free (map);
  200. isl_space_free (space);
  201. return 0;
  202. }
  203. /* Extends the output dimension of MAP to MAX dimensions. */
  204. static __isl_give isl_map *
  205. extend_map (__isl_take isl_map *map, int max)
  206. {
  207. isl_space *space = isl_map_get_space (map);
  208. int n = isl_space_dim (space, isl_dim_out);
  209. isl_space_free (space);
  210. return isl_map_add_dims (map, isl_dim_out, max - n);
  211. }
  212. /* Structure used to pass parameters to extend_schedule_1. */
  213. struct extend_schedule_str {
  214. int max;
  215. isl_union_map *umap;
  216. };
  217. /* Helper function for extend_schedule. */
  218. static int
  219. extend_schedule_1 (__isl_take isl_map *map, void *user)
  220. {
  221. struct extend_schedule_str *str = (struct extend_schedule_str *) user;
  222. str->umap = isl_union_map_add_map (str->umap, extend_map (map, str->max));
  223. return 0;
  224. }
  225. /* Return a relation that has uniform output dimensions. */
  226. __isl_give isl_union_map *
  227. extend_schedule (__isl_take isl_union_map *x)
  228. {
  229. int max = 0;
  230. int res;
  231. struct extend_schedule_str str;
  232. res = isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max);
  233. gcc_assert (res == 0);
  234. str.max = max;
  235. str.umap = isl_union_map_empty (isl_union_map_get_space (x));
  236. res = isl_union_map_foreach_map (x, extend_schedule_1, (void *) &str);
  237. gcc_assert (res == 0);
  238. isl_union_map_free (x);
  239. return str.umap;
  240. }
  241. /* Applies SCHEDULE to the in and out dimensions of the dependences
  242. DEPS and return the resulting relation. */
  243. static isl_map *
  244. apply_schedule_on_deps (__isl_keep isl_union_map *schedule,
  245. __isl_keep isl_union_map *deps)
  246. {
  247. isl_map *x;
  248. isl_union_map *ux, *trans;
  249. trans = isl_union_map_copy (schedule);
  250. trans = extend_schedule (trans);
  251. ux = isl_union_map_copy (deps);
  252. ux = isl_union_map_apply_domain (ux, isl_union_map_copy (trans));
  253. ux = isl_union_map_apply_range (ux, trans);
  254. if (isl_union_map_is_empty (ux))
  255. {
  256. isl_union_map_free (ux);
  257. return NULL;
  258. }
  259. x = isl_map_from_union_map (ux);
  260. return x;
  261. }
  262. /* Return true when SCHEDULE does not violate the data DEPS: that is
  263. when the intersection of LEX with the DEPS transformed by SCHEDULE
  264. is empty. LEX is the relation in which the outputs occur before
  265. the inputs. */
  266. static bool
  267. no_violations (__isl_keep isl_union_map *schedule,
  268. __isl_keep isl_union_map *deps)
  269. {
  270. bool res;
  271. isl_space *space;
  272. isl_map *lex, *x;
  273. if (isl_union_map_is_empty (deps))
  274. return true;
  275. x = apply_schedule_on_deps (schedule, deps);
  276. space = isl_map_get_space (x);
  277. space = isl_space_range (space);
  278. lex = isl_map_lex_ge (space);
  279. x = isl_map_intersect (x, lex);
  280. res = isl_map_is_empty (x);
  281. isl_map_free (x);
  282. return res;
  283. }
  284. /* Return true when DEPS is non empty and the intersection of LEX with
  285. the DEPS transformed by SCHEDULE is non empty. LEX is the relation
  286. in which all the inputs before DEPTH occur at the same time as the
  287. output, and the input at DEPTH occurs before output. */
  288. bool
  289. carries_deps (__isl_keep isl_union_map *schedule,
  290. __isl_keep isl_union_map *deps,
  291. int depth)
  292. {
  293. bool res;
  294. int i;
  295. isl_space *space;
  296. isl_map *lex, *x;
  297. isl_constraint *ineq;
  298. if (isl_union_map_is_empty (deps))
  299. return false;
  300. x = apply_schedule_on_deps (schedule, deps);
  301. if (x == NULL)
  302. return false;
  303. space = isl_map_get_space (x);
  304. space = isl_space_range (space);
  305. lex = isl_map_lex_le (space);
  306. space = isl_map_get_space (x);
  307. ineq = isl_inequality_alloc (isl_local_space_from_space (space));
  308. for (i = 0; i < depth - 1; i++)
  309. lex = isl_map_equate (lex, isl_dim_in, i, isl_dim_out, i);
  310. /* in + 1 <= out */
  311. ineq = isl_constraint_set_coefficient_si (ineq, isl_dim_out, depth - 1, 1);
  312. ineq = isl_constraint_set_coefficient_si (ineq, isl_dim_in, depth - 1, -1);
  313. ineq = isl_constraint_set_constant_si (ineq, -1);
  314. lex = isl_map_add_constraint (lex, ineq);
  315. x = isl_map_intersect (x, lex);
  316. res = !isl_map_is_empty (x);
  317. isl_map_free (x);
  318. return res;
  319. }
  320. /* Subtract from the RAW, WAR, and WAW dependences those relations
  321. that have been marked as belonging to an associative commutative
  322. reduction. */
  323. static void
  324. subtract_commutative_associative_deps (scop_p scop,
  325. vec<poly_bb_p> pbbs,
  326. isl_union_map *original,
  327. isl_union_map **must_raw,
  328. isl_union_map **may_raw,
  329. isl_union_map **must_raw_no_source,
  330. isl_union_map **may_raw_no_source,
  331. isl_union_map **must_war,
  332. isl_union_map **may_war,
  333. isl_union_map **must_war_no_source,
  334. isl_union_map **may_war_no_source,
  335. isl_union_map **must_waw,
  336. isl_union_map **may_waw,
  337. isl_union_map **must_waw_no_source,
  338. isl_union_map **may_waw_no_source)
  339. {
  340. int i, j;
  341. poly_bb_p pbb;
  342. poly_dr_p pdr;
  343. isl_space *space = isl_set_get_space (scop->context);
  344. FOR_EACH_VEC_ELT (pbbs, i, pbb)
  345. if (PBB_IS_REDUCTION (pbb))
  346. {
  347. int res;
  348. isl_union_map *r = isl_union_map_empty (isl_space_copy (space));
  349. isl_union_map *must_w = isl_union_map_empty (isl_space_copy (space));
  350. isl_union_map *may_w = isl_union_map_empty (isl_space_copy (space));
  351. isl_union_map *all_w;
  352. isl_union_map *empty;
  353. isl_union_map *x_must_raw;
  354. isl_union_map *x_may_raw;
  355. isl_union_map *x_must_raw_no_source;
  356. isl_union_map *x_may_raw_no_source;
  357. isl_union_map *x_must_war;
  358. isl_union_map *x_may_war;
  359. isl_union_map *x_must_war_no_source;
  360. isl_union_map *x_may_war_no_source;
  361. isl_union_map *x_must_waw;
  362. isl_union_map *x_may_waw;
  363. isl_union_map *x_must_waw_no_source;
  364. isl_union_map *x_may_waw_no_source;
  365. FOR_EACH_VEC_ELT (PBB_DRS (pbb), j, pdr)
  366. if (pdr_read_p (pdr))
  367. r = isl_union_map_add_map (r, add_pdr_constraints (pdr, pbb));
  368. FOR_EACH_VEC_ELT (PBB_DRS (pbb), j, pdr)
  369. if (pdr_write_p (pdr))
  370. must_w = isl_union_map_add_map (must_w,
  371. add_pdr_constraints (pdr, pbb));
  372. FOR_EACH_VEC_ELT (PBB_DRS (pbb), j, pdr)
  373. if (pdr_may_write_p (pdr))
  374. may_w = isl_union_map_add_map (may_w,
  375. add_pdr_constraints (pdr, pbb));
  376. all_w = isl_union_map_union
  377. (isl_union_map_copy (must_w), isl_union_map_copy (may_w));
  378. empty = isl_union_map_empty (isl_union_map_get_space (all_w));
  379. res = isl_union_map_compute_flow (isl_union_map_copy (r),
  380. isl_union_map_copy (must_w),
  381. isl_union_map_copy (may_w),
  382. isl_union_map_copy (original),
  383. &x_must_raw, &x_may_raw,
  384. &x_must_raw_no_source,
  385. &x_may_raw_no_source);
  386. gcc_assert (res == 0);
  387. res = isl_union_map_compute_flow (isl_union_map_copy (all_w),
  388. r, empty,
  389. isl_union_map_copy (original),
  390. &x_must_war, &x_may_war,
  391. &x_must_war_no_source,
  392. &x_may_war_no_source);
  393. gcc_assert (res == 0);
  394. res = isl_union_map_compute_flow (all_w, must_w, may_w,
  395. isl_union_map_copy (original),
  396. &x_must_waw, &x_may_waw,
  397. &x_must_waw_no_source,
  398. &x_may_waw_no_source);
  399. gcc_assert (res == 0);
  400. if (must_raw)
  401. *must_raw = isl_union_map_subtract (*must_raw, x_must_raw);
  402. else
  403. isl_union_map_free (x_must_raw);
  404. if (may_raw)
  405. *may_raw = isl_union_map_subtract (*may_raw, x_may_raw);
  406. else
  407. isl_union_map_free (x_may_raw);
  408. if (must_raw_no_source)
  409. *must_raw_no_source = isl_union_map_subtract (*must_raw_no_source,
  410. x_must_raw_no_source);
  411. else
  412. isl_union_map_free (x_must_raw_no_source);
  413. if (may_raw_no_source)
  414. *may_raw_no_source = isl_union_map_subtract (*may_raw_no_source,
  415. x_may_raw_no_source);
  416. else
  417. isl_union_map_free (x_may_raw_no_source);
  418. if (must_war)
  419. *must_war = isl_union_map_subtract (*must_war, x_must_war);
  420. else
  421. isl_union_map_free (x_must_war);
  422. if (may_war)
  423. *may_war = isl_union_map_subtract (*may_war, x_may_war);
  424. else
  425. isl_union_map_free (x_may_war);
  426. if (must_war_no_source)
  427. *must_war_no_source = isl_union_map_subtract (*must_war_no_source,
  428. x_must_war_no_source);
  429. else
  430. isl_union_map_free (x_must_war_no_source);
  431. if (may_war_no_source)
  432. *may_war_no_source = isl_union_map_subtract (*may_war_no_source,
  433. x_may_war_no_source);
  434. else
  435. isl_union_map_free (x_may_war_no_source);
  436. if (must_waw)
  437. *must_waw = isl_union_map_subtract (*must_waw, x_must_waw);
  438. else
  439. isl_union_map_free (x_must_waw);
  440. if (may_waw)
  441. *may_waw = isl_union_map_subtract (*may_waw, x_may_waw);
  442. else
  443. isl_union_map_free (x_may_waw);
  444. if (must_waw_no_source)
  445. *must_waw_no_source = isl_union_map_subtract (*must_waw_no_source,
  446. x_must_waw_no_source);
  447. else
  448. isl_union_map_free (x_must_waw_no_source);
  449. if (may_waw_no_source)
  450. *may_waw_no_source = isl_union_map_subtract (*may_waw_no_source,
  451. x_may_waw_no_source);
  452. else
  453. isl_union_map_free (x_may_waw_no_source);
  454. }
  455. isl_union_map_free (original);
  456. isl_space_free (space);
  457. }
  458. /* Compute the original data dependences in SCOP for all the reads and
  459. writes in PBBS. */
  460. void
  461. compute_deps (scop_p scop, vec<poly_bb_p> pbbs,
  462. isl_union_map **must_raw,
  463. isl_union_map **may_raw,
  464. isl_union_map **must_raw_no_source,
  465. isl_union_map **may_raw_no_source,
  466. isl_union_map **must_war,
  467. isl_union_map **may_war,
  468. isl_union_map **must_war_no_source,
  469. isl_union_map **may_war_no_source,
  470. isl_union_map **must_waw,
  471. isl_union_map **may_waw,
  472. isl_union_map **must_waw_no_source,
  473. isl_union_map **may_waw_no_source)
  474. {
  475. isl_union_map *reads = scop_get_reads (scop, pbbs);
  476. isl_union_map *must_writes = scop_get_must_writes (scop, pbbs);
  477. isl_union_map *may_writes = scop_get_may_writes (scop, pbbs);
  478. isl_union_map *all_writes = isl_union_map_union
  479. (isl_union_map_copy (must_writes), isl_union_map_copy (may_writes));
  480. isl_space *space = isl_union_map_get_space (all_writes);
  481. isl_union_map *empty = isl_union_map_empty (space);
  482. isl_union_map *original = scop_get_original_schedule (scop, pbbs);
  483. int res;
  484. res = isl_union_map_compute_flow (isl_union_map_copy (reads),
  485. isl_union_map_copy (must_writes),
  486. isl_union_map_copy (may_writes),
  487. isl_union_map_copy (original),
  488. must_raw, may_raw, must_raw_no_source,
  489. may_raw_no_source);
  490. gcc_assert (res == 0);
  491. res = isl_union_map_compute_flow (isl_union_map_copy (all_writes),
  492. reads, empty,
  493. isl_union_map_copy (original),
  494. must_war, may_war, must_war_no_source,
  495. may_war_no_source);
  496. gcc_assert (res == 0);
  497. res = isl_union_map_compute_flow (all_writes, must_writes, may_writes,
  498. isl_union_map_copy (original),
  499. must_waw, may_waw, must_waw_no_source,
  500. may_waw_no_source);
  501. gcc_assert (res == 0);
  502. subtract_commutative_associative_deps
  503. (scop, pbbs, original,
  504. must_raw, may_raw, must_raw_no_source, may_raw_no_source,
  505. must_war, may_war, must_war_no_source, may_war_no_source,
  506. must_waw, may_waw, must_waw_no_source, may_waw_no_source);
  507. }
  508. /* Given a TRANSFORM, check whether it respects the original
  509. dependences in SCOP. Returns true when TRANSFORM is a safe
  510. transformation. */
  511. static bool
  512. transform_is_safe (scop_p scop, isl_union_map *transform)
  513. {
  514. bool res;
  515. if (!scop->must_raw)
  516. compute_deps (scop, SCOP_BBS (scop),
  517. &scop->must_raw, &scop->may_raw,
  518. &scop->must_raw_no_source, &scop->may_raw_no_source,
  519. &scop->must_war, &scop->may_war,
  520. &scop->must_war_no_source, &scop->may_war_no_source,
  521. &scop->must_waw, &scop->may_waw,
  522. &scop->must_waw_no_source, &scop->may_waw_no_source);
  523. res = (no_violations (transform, scop->must_raw)
  524. && no_violations (transform, scop->may_raw)
  525. && no_violations (transform, scop->must_war)
  526. && no_violations (transform, scop->may_war)
  527. && no_violations (transform, scop->must_waw)
  528. && no_violations (transform, scop->may_waw));
  529. isl_union_map_free (transform);
  530. return res;
  531. }
  532. /* Return true when the SCOP transformed schedule is correct. */
  533. bool
  534. graphite_legal_transform (scop_p scop)
  535. {
  536. int res;
  537. isl_union_map *transform;
  538. timevar_push (TV_GRAPHITE_DATA_DEPS);
  539. transform = scop_get_transformed_schedule (scop, SCOP_BBS (scop));
  540. res = transform_is_safe (scop, transform);
  541. timevar_pop (TV_GRAPHITE_DATA_DEPS);
  542. return res;
  543. }
  544. #endif