This repository was archived by the owner on Apr 28, 2023. It is now read-only.
Commit b81795e
Sven Verdoolaege
makeScheduleTree: also extract polyhedral representation of reductions
Reductions are currently represented by lists of reduction dimensions
in the domains of the reduction update statements.
The detection of reductions in the schedule tree, based on this information,
may work out in practice, but it is difficult to reason about and
is technically incorrect.
This detection will be replaced by one that is based
on a polyhedral representation. This commit introduces
this polyhedral representation.
In particular, each individual reduction (a set of updates
to a given tensor element) is represented by an element
in a reduction space, along with a mapping from the
update statement instances that contribute to that reduction.
The obvious choice for such a reduction space would be
the space of the tensor involved in the reduction.
However, there may in theory be multiple reductions
on the same tensor element separated by some other statement,
even though this is currently impossible inside TC.
Still, since the reductions are extracted from Halide,
it's best to only use information available in the Halide
representation and to not assume an identity matching
between reductions and tensor elements.
It is not immediately obvious what would be the best representation
for reductions. This commit uses an isl::union_map representation,
but an isl::union_pw_multi_aff would also work.
This commit only extracts a polyhedral representation of reductions,
temporarily resulting in a duplicate representation of reductions.
After all uses of the AST representation of reductions have been
replaced by uses of the polyhedral representation, the AST representation
will be removed.1 parent 381dc6c commit b81795e
4 files changed
+119
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
345 | 421 | | |
346 | 422 | | |
347 | 423 | | |
| |||
369 | 445 | | |
370 | 446 | | |
371 | 447 | | |
372 | | - | |
| 448 | + | |
373 | 449 | | |
374 | 450 | | |
375 | 451 | | |
| |||
460 | 536 | | |
461 | 537 | | |
462 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
463 | 542 | | |
464 | 543 | | |
465 | 544 | | |
| 545 | + | |
466 | 546 | | |
467 | 547 | | |
468 | 548 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
42 | 77 | | |
43 | 78 | | |
44 | 79 | | |
| |||
0 commit comments