[ZoneAlgo] Translate addArrayWriteAccess to isl++. NFC.

llvm-svn: 316459
This commit is contained in:
Michael Kruse 2017-10-24 16:40:34 +00:00
parent b874042e32
commit 983fa9bf23
1 changed files with 7 additions and 11 deletions

View File

@ -446,30 +446,26 @@ void ZoneAlgorithm::addArrayWriteAccess(MemoryAccess *MA) {
auto *Stmt = MA->getStatement();
// { Domain[] -> Element[] }
auto AccRel = intersectRange(getAccessRelationFor(MA), CompatibleElts);
isl::map AccRel = intersectRange(getAccessRelationFor(MA), CompatibleElts);
if (MA->isMustWrite())
AllMustWrites =
give(isl_union_map_add_map(AllMustWrites.take(), AccRel.copy()));
AllMustWrites = AllMustWrites.add_map(AccRel);
if (MA->isMayWrite())
AllMayWrites =
give(isl_union_map_add_map(AllMayWrites.take(), AccRel.copy()));
AllMayWrites = AllMayWrites.add_map(AccRel);
// { Domain[] -> ValInst[] }
auto WriteValInstance = getWrittenValue(MA, AccRel);
isl::map WriteValInstance = getWrittenValue(MA, AccRel);
if (!WriteValInstance)
WriteValInstance = makeUnknownForDomain(Stmt);
// { Domain[] -> [Element[] -> Domain[]] }
auto IncludeElement = give(isl_map_curry(isl_map_domain_map(AccRel.copy())));
isl::map IncludeElement = AccRel.domain_map().curry();
// { [Element[] -> DomainWrite[]] -> ValInst[] }
auto EltWriteValInst = give(
isl_map_apply_domain(WriteValInstance.take(), IncludeElement.take()));
isl::map EltWriteValInst = WriteValInstance.apply_domain(IncludeElement);
AllWriteValInst = give(
isl_union_map_add_map(AllWriteValInst.take(), EltWriteValInst.take()));
AllWriteValInst = AllWriteValInst.add_map(EltWriteValInst);
}
isl::union_set ZoneAlgorithm::makeEmptyUnionSet() const {