@@ -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