Pass an actual schedule to the isl_union_access [NFC]

This change is a step towards using a single isl_schedule object throughout
Polly. At the moment the schedule is just constructed from the flat
isl_union_map that defines the schedule. Later we will obtain it directly
from the scop and potentially obtain a schedule with a non-trivial internal
structure that will allow faster dependence analysis.

llvm-svn: 235378
This commit is contained in:
Tobias Grosser 2015-04-21 11:01:34 +00:00
parent 41b0100dea
commit b69d16ab24
1 changed files with 14 additions and 14 deletions

View File

@ -33,6 +33,7 @@
#include <isl/map.h>
#include <isl/options.h>
#include <isl/set.h>
#include <isl/schedule.h>
using namespace polly;
using namespace llvm;
@ -218,13 +219,13 @@ void Dependences::addPrivatizationDependences() {
void Dependences::calculateDependences(Scop &S) {
isl_union_map *Read, *Write, *MayWrite, *AccessSchedule, *StmtSchedule,
*Schedule;
*ScheduleMap;
DEBUG(dbgs() << "Scop: \n" << S << "\n");
collectInfo(S, &Read, &Write, &MayWrite, &AccessSchedule, &StmtSchedule);
Schedule =
ScheduleMap =
isl_union_map_union(AccessSchedule, isl_union_map_copy(StmtSchedule));
Read = isl_union_map_coalesce(Read);
@ -239,10 +240,15 @@ void Dependences::calculateDependences(Scop &S) {
DEBUG(dbgs() << "Read: " << Read << "\n";
dbgs() << "Write: " << Write << "\n";
dbgs() << "MayWrite: " << MayWrite << "\n";
dbgs() << "Schedule: " << Schedule << "\n");
dbgs() << "Schedule: " << ScheduleMap << "\n");
RAW = WAW = WAR = RED = nullptr;
auto *Schedule = isl_schedule_from_domain(
isl_union_map_domain(isl_union_map_copy(ScheduleMap)));
Schedule = isl_schedule_insert_partial_schedule(
Schedule, isl_multi_union_pw_aff_from_union_map(ScheduleMap));
if (OptAnalysisType == VALUE_BASED_ANALYSIS) {
isl_union_access_info *AI;
isl_union_flow *Flow;
@ -250,8 +256,7 @@ void Dependences::calculateDependences(Scop &S) {
AI = isl_union_access_info_from_sink(isl_union_map_copy(Read));
AI = isl_union_access_info_set_must_source(AI, isl_union_map_copy(Write));
AI = isl_union_access_info_set_may_source(AI, isl_union_map_copy(MayWrite));
AI = isl_union_access_info_set_schedule_map(AI,
isl_union_map_copy(Schedule));
AI = isl_union_access_info_set_schedule(AI, isl_schedule_copy(Schedule));
Flow = isl_union_access_info_compute_flow(AI);
RAW = isl_union_flow_get_must_dependence(Flow);
@ -260,8 +265,7 @@ void Dependences::calculateDependences(Scop &S) {
AI = isl_union_access_info_from_sink(isl_union_map_copy(Write));
AI = isl_union_access_info_set_must_source(AI, isl_union_map_copy(Write));
AI = isl_union_access_info_set_may_source(AI, isl_union_map_copy(Read));
AI = isl_union_access_info_set_schedule_map(AI,
isl_union_map_copy(Schedule));
AI = isl_union_access_info_set_schedule(AI, Schedule);
Flow = isl_union_access_info_compute_flow(AI);
WAW = isl_union_flow_get_must_dependence(Flow);
@ -282,8 +286,7 @@ void Dependences::calculateDependences(Scop &S) {
AI = isl_union_access_info_from_sink(isl_union_map_copy(Read));
AI = isl_union_access_info_set_may_source(AI, isl_union_map_copy(Write));
AI = isl_union_access_info_set_schedule_map(AI,
isl_union_map_copy(Schedule));
AI = isl_union_access_info_set_schedule(AI, isl_schedule_copy(Schedule));
Flow = isl_union_access_info_compute_flow(AI);
RAW = isl_union_flow_get_may_dependence(Flow);
@ -291,8 +294,7 @@ void Dependences::calculateDependences(Scop &S) {
AI = isl_union_access_info_from_sink(isl_union_map_copy(Write));
AI = isl_union_access_info_set_may_source(AI, isl_union_map_copy(Read));
AI = isl_union_access_info_set_schedule_map(AI,
isl_union_map_copy(Schedule));
AI = isl_union_access_info_set_schedule(AI, isl_schedule_copy(Schedule));
Flow = isl_union_access_info_compute_flow(AI);
WAR = isl_union_flow_get_may_dependence(Flow);
@ -300,8 +302,7 @@ void Dependences::calculateDependences(Scop &S) {
AI = isl_union_access_info_from_sink(isl_union_map_copy(Write));
AI = isl_union_access_info_set_may_source(AI, isl_union_map_copy(Write));
AI = isl_union_access_info_set_schedule_map(AI,
isl_union_map_copy(Schedule));
AI = isl_union_access_info_set_schedule(AI, Schedule);
Flow = isl_union_access_info_compute_flow(AI);
WAW = isl_union_flow_get_may_dependence(Flow);
@ -311,7 +312,6 @@ void Dependences::calculateDependences(Scop &S) {
isl_union_map_free(MayWrite);
isl_union_map_free(Write);
isl_union_map_free(Read);
isl_union_map_free(Schedule);
RAW = isl_union_map_coalesce(RAW);
WAW = isl_union_map_coalesce(WAW);