[polly] r235378 - Pass an actual schedule to the isl_union_access [NFC]
Tobias Grosser
tobias at grosser.es
Tue Apr 21 04:01:34 PDT 2015
Author: grosser
Date: Tue Apr 21 06:01:34 2015
New Revision: 235378
URL: http://llvm.org/viewvc/llvm-project?rev=235378&view=rev
Log:
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.
Modified:
polly/trunk/lib/Analysis/DependenceInfo.cpp
Modified: polly/trunk/lib/Analysis/DependenceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/DependenceInfo.cpp?rev=235378&r1=235377&r2=235378&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Tue Apr 21 06:01:34 2015
@@ -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::addPrivatizationDepend
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(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(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(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(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(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(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(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);
More information about the llvm-commits
mailing list