Skip to content

Commit 515c1f7

Browse files
committed
Revert "last ok"
This reverts commit d037d8a0978d4b90c791726b9ebedc75f61eb249.
1 parent b400cdb commit 515c1f7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

include/tsar/Analysis/Memory/MemoryLocationRange.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ struct MemoryLocationRange {
223223
if (DimList.empty())
224224
return *this;
225225
assert(UpperBound.hasValue() && "UpperBound must have a value!");
226-
auto FullSize = UpperBound.getValue();
227-
// FIXME: rewrite with zero dimension; incorrect algorithm.
226+
auto FullSize = UpperBound.getValue();;
228227
for (std::size_t I = 1; I < DimList.size(); ++I)
229228
FullSize *= DimList[I].DimSize;
230229
return MemoryLocationRange(Ptr, 0, LocationSize(FullSize), AATags);

lib/Analysis/Memory/DefinedMemory.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,22 +401,19 @@ std::pair<MemoryLocationRange, bool> aggregate(
401401
// for <lhs[?]:1..4, 0, 600>: cover all array
402402
bool IsNonCollapsable = false;
403403
auto FullSize = ElemSize;
404-
for (size_t I = 0; I < ArrayPtr->getNumberOfDims(); ++I) {
404+
for (size_t I = 1; I < ArrayPtr->getNumberOfDims(); ++I) {
405405
auto DimSizeSCEV = ArrayPtr->getDimSize(I);
406406
if (ArrayPtr->isKnownDimSize(I) && isa<SCEVConstant>(DimSizeSCEV)) {
407-
LLVM_DEBUG(dbgs() << "Dim size: [" << cast<SCEVConstant>(DimSizeSCEV)->getAPInt().getZExtValue() << "]\n");
408407
FullSize *= cast<SCEVConstant>(DimSizeSCEV)->getAPInt().getZExtValue();
409408
} else {
410409
IsNonCollapsable = true;
411410
break;
412411
}
413412
}
414-
if (!IsNonCollapsable && FullSize > 0) {
415-
ResLoc.Ptr = GV;
413+
if (!IsNonCollapsable) {
416414
ResLoc.LowerBound = 0;
417415
ResLoc.UpperBound = FullSize;
418416
ResLoc.Kind = LocKind::Default;
419-
LLVM_DEBUG(dbgs() << "Extend location: "; printLocationSource(dbgs(), ResLoc); dbgs() << "\n");
420417
}
421418
}
422419
return std::make_pair(ResLoc, true);
@@ -1316,7 +1313,7 @@ void ReachDFFwk::collapse(DFRegion *R) {
13161313
continue;
13171314
}
13181315
//LLVM_DEBUG(printLocInfo("[COLLAPSE] Collapse Use location: ", Loc));
1319-
distribute(aggregate(R, N, Loc, this, true), Loc, OwnUses, OtherUses);
1316+
distribute(aggregate(R, N, Loc, this), Loc, OwnUses, OtherUses);
13201317
}
13211318
LocationSet NewUses;
13221319
for (auto &Loc : OwnUses) {

0 commit comments

Comments
 (0)