@@ -268,7 +268,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
268268 // `Auxiliary Default` only.
269269 if ((Loc.Kind & ~LocKind::Auxiliary) != LocKind::Default)
270270 return std::make_pair (Loc, true );
271- LLVM_DEBUG (dbgs () << " [AGGREGATE] Aggregate loc: " ; printLocationSource (dbgs (), Loc); dbgs () << " \n " );
271+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Aggregate loc: "; printLocationSource(dbgs(), Loc); dbgs() << "\n");
272272 MemoryLocationRange ResLoc (Loc);
273273 auto *SE = Fwk->getScalarEvolution ();
274274 assert (SE && " ScalarEvolution must be specified!" );
@@ -278,7 +278,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
278278 auto ArrayPtr = LocInfo.first ;
279279 if (!ArrayPtr || !ArrayPtr->isDelinearized () || !LocInfo.second ->isValid ()) {
280280 // LLVM_DEBUG(dbgs() << "[AGGREGATE] Failed to delinearize location.\n");
281- LLVM_DEBUG (
281+ /* LLVM_DEBUG(
282282 dbgs() << "[AGGREGATE] Failed to delinearize location: ";
283283 printLocationSource(dbgs(), Loc);
284284 dbgs() << ". Reason: ";
@@ -289,18 +289,18 @@ std::pair<MemoryLocationRange, bool> aggregate(
289289 else
290290 dbgs() << "!LocInfo.second->isValid()";
291291 dbgs() << "\n";
292- );
292+ );*/
293293 ResLoc.Kind = LocKind::Default;
294294 return std::make_pair (ResLoc, true );
295295 }
296296 /* LLVM_DEBUG(dbgs() << "[AGGREGATE] Array info: " << *ArrayPtr->getBase() <<
297297 ", IsAddress: " << ArrayPtr->isAddressOfVariable() << ".\n");*/
298298 auto ArrayType{getPointerElementType (*ArrayPtr->getBase ())};
299299 if (!ArrayType || ArrayPtr->isAddressOfVariable ()) {
300- if (!ArrayType)
300+ /* if (!ArrayType)
301301 LLVM_DEBUG(dbgs() << "[AGGREGATE] Not array type: "; printLocationSource(dbgs(), Loc); dbgs() << "\n");
302302 else
303- LLVM_DEBUG (dbgs () << " [AGGREGATE] IsAddress of variable: " ; printLocationSource (dbgs (), Loc); dbgs () << " \n " );
303+ LLVM_DEBUG(dbgs() << "[AGGREGATE] IsAddress of variable: "; printLocationSource(dbgs(), Loc); dbgs() << "\n");*/
304304 ResLoc.Kind = LocKind::NonCollapsable;
305305 return std::make_pair (ResLoc, true );
306306 }
@@ -310,7 +310,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
310310 auto ArraySizeInfo = arraySize (ArrayType);
311311 if (ArraySizeInfo == std::make_tuple (0 , 1 , ArrayType) &&
312312 ArrayPtr->getNumberOfDims () != 1 ) {
313- LLVM_DEBUG (dbgs () << " [AGGREGATE] Failed to get array size for " ; printLocationSource (dbgs (), Loc); dbgs () << " \n " );
313+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Failed to get array size for "; printLocationSource(dbgs(), Loc); dbgs() << "\n");
314314 ResLoc.Kind = LocKind::NonCollapsable;
315315 return std::make_pair (ResLoc, true );
316316 }
@@ -375,15 +375,15 @@ std::pair<MemoryLocationRange, bool> aggregate(
375375 }
376376 }
377377
378- LLVM_DEBUG (dbgs () << " [AGGREGATE] IsScalable: " << Fwk->getDataLayout ().getTypeStoreSize (ElemType).isScalable () << " \n " );
378+ /* LLVM_DEBUG(dbgs() << "[AGGREGATE] IsScalable: " << Fwk->getDataLayout().getTypeStoreSize(ElemType).isScalable() << "\n");
379379 LLVM_DEBUG(dbgs() << "ElemSize:" << Fwk->getDataLayout().getTypeStoreSize(ElemType) << "\n");
380- LLVM_DEBUG (dbgs () << " Subscripts size: " << LocInfo.second ->Subscripts .size () << " \n " );
380+ LLVM_DEBUG(dbgs() << "Subscripts size: " << LocInfo.second->Subscripts.size() << "\n");*/
381381 // if (LocInfo.second->Subscripts.size() == 1) {
382382 for (auto *S : LocInfo.second ->Subscripts ) {
383383 S->dump ();
384384 }
385385 // }
386- LLVM_DEBUG (dbgs () << " BasePtr == GV: " << (BasePtr == GV) << " \n " );
386+ /* LLVM_DEBUG(dbgs() << "BasePtr == GV: " << (BasePtr == GV) << "\n");
387387 LLVM_DEBUG(dbgs() << "Number of dims: " << ArrayPtr->getNumberOfDims() << "\n");
388388 LLVM_DEBUG(dbgs() << "size() != numOfDims: " << (LocInfo.second->Subscripts.size() != ArrayPtr->getNumberOfDims()) << "\n");
389389 LLVM_DEBUG(
@@ -393,9 +393,9 @@ std::pair<MemoryLocationRange, bool> aggregate(
393393 Ty->dump();
394394 ++I;
395395 }
396- );
397- dbgs () << " Underlying object: " << GV << " \n " ;
398- dbgs () << " BasePtr: " << BasePtr << " \n " ;
396+ );*/
397+ // dbgs() << "Underlying object: " << GV << "\n";
398+ // dbgs() << "BasePtr: " << BasePtr << "\n";
399399 ResLoc.Kind = LocKind::NonCollapsable;
400400 if (IsUse) {
401401 // for <lhs[?]:1..4, 0, 600>: cover all array
@@ -428,30 +428,30 @@ std::pair<MemoryLocationRange, bool> aggregate(
428428 ResLoc.Kind = LocKind::NonCollapsable;
429429 // LLVM_DEBUG(dbgs() << "[AGGREGATE] Subscript: " << *S << "\n");
430430 if (!ArrayPtr->isKnownDimSize (DimensionN) && DimensionN != 0 ) {
431- LLVM_DEBUG (dbgs () << " [AGGREGATE] Failed to get dimension "
431+ /* LLVM_DEBUG(dbgs() << "[AGGREGATE] Failed to get dimension "
432432 "size for required dimension `" << DimensionN <<
433- " `.\n " );
433+ "`.\n");*/
434434 break ;
435435 }
436436 Dimension DimInfo;
437437 if (auto *C = dyn_cast<SCEVConstant>(ArrayPtr->getDimSize (DimensionN))) {
438438 DimInfo.DimSize = C->getAPInt ().getZExtValue ();
439439 } else {
440- LLVM_DEBUG (dbgs () << " [AGGREGATE] Non-constant dimension size.\n " );
440+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Non-constant dimension size.\n");
441441 if (DimensionN != 0 ) {
442- LLVM_DEBUG (dbgs () << " [AGGREGATE] Here1.\n " );
442+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Here1.\n");
443443 break ;
444444 }
445445 }
446446 auto AddRecInfo = computeSCEVAddRec (S, *SE);
447447 if (Fwk->getGlobalOptions ().IsSafeTypeCast && !AddRecInfo.second ) {
448- LLVM_DEBUG (dbgs () << " [AGGREGATE] Here2.\n " );
448+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Here2.\n");
449449 break ;
450450 }
451451 auto SCEV = AddRecInfo.first ;
452452 if (auto C = dyn_cast<SCEVConstant>(SCEV)) {
453453 if (C->getAPInt ().isNegative ()) {
454- LLVM_DEBUG (dbgs () << " [AGGREGATE] Here3.\n " );
454+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Here3.\n");
455455 break ;
456456 }
457457 ++ConstMatchCount;
@@ -461,7 +461,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
461461 ResLoc.Kind = LocKind::Collapsed;
462462 } else if (auto C = dyn_cast<SCEVAddRecExpr>(SCEV)) {
463463 if (!R && N) {
464- LLVM_DEBUG (dbgs () << " [AGGREGATE] Region == nullptr.\n " );
464+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Region == nullptr.\n");
465465 ResLoc.Kind = LocKind::Default;
466466 break ;
467467 }
@@ -475,13 +475,13 @@ std::pair<MemoryLocationRange, bool> aggregate(
475475 }
476476 auto *StepSCEV = C->getStepRecurrence (*SE);
477477 if (!isa<SCEVConstant>(StepSCEV)) {
478- LLVM_DEBUG (dbgs () << " [AGGREGATE] Non-constant step.\n " );
478+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Non-constant step.\n");
479479 break ;
480480 }
481481 auto AddRecStep = cast<SCEVConstant>(StepSCEV)->getAPInt ().getSExtValue ();
482482 if (!C->getLoop ()->getExitingBlock () || !C->getLoop ()->getLoopLatch ()) {
483- LLVM_DEBUG (dbgs () << " [AGGREGATE] Multiple exiting and latch blocks "
484- " are prohibited.\n " );
483+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Multiple exiting and latch blocks "
484+ // "are prohibited.\n");
485485 break ;
486486 }
487487 unsigned int TripCount = 0 ;
@@ -500,7 +500,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
500500 SE->getBackedgeTakenCount (C->getLoop ())))
501501 TripCount = BTC->getAPInt ().getZExtValue ();
502502 } else {
503- LLVM_DEBUG (dbgs () << " [AGGREGATE] Here4.\n " );
503+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Here4.\n");
504504 break ;
505505 }
506506 } else {
@@ -515,42 +515,42 @@ std::pair<MemoryLocationRange, bool> aggregate(
515515 // LLVM_DEBUG(dbgs() << "[AGGREGATE] Aggregate a constant range.\n");
516516 int64_t SignedRangeMin = SE->getSignedRangeMin (SCEV).getSExtValue ();
517517 if (SignedRangeMin < 0 ) {
518- LLVM_DEBUG (dbgs () << " [AGGREGATE] Range bounds must be "
519- " non-negative.\n " );
518+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Range bounds must be "
519+ // "non-negative.\n");
520520 break ;
521521 }
522522 DimInfo.Start = SE->getConstant (SCEV->getType (), SignedRangeMin);
523523 DimInfo.End = SE->getConstant (SCEV->getType (),
524524 SignedRangeMin + std::abs (AddRecStep) * (TripCount - 1 ));
525525 } else {
526526 if (std::abs (AddRecStep) != 1 ) {
527- LLVM_DEBUG (dbgs () << " [AGGREGATE] Here5.\n " );
527+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Here5.\n");
528528 break ;
529529 }
530530 auto Bounds = C->getLoop ()->getBounds (*SE);
531531 if (!Bounds) {
532- LLVM_DEBUG (dbgs () << " [AGGREGATE] Failed to get loop bounds.\n " );
532+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Failed to get loop bounds.\n");
533533 break ;
534534 }
535535 auto *InitValue = &Bounds->getInitialIVValue ();
536536 auto *FinalValue = &Bounds->getFinalIVValue ();
537537 if (!SE->isSCEVable (InitValue->getType ()) ||
538538 !SE->isSCEVable (FinalValue->getType ())) {
539- LLVM_DEBUG (dbgs () << " [AGGREGATE] Loop bound is not SCEVable.\n " );
539+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Loop bound is not SCEVable.\n");
540540 break ;
541541 }
542542 if (!InitValue->getType ()->isIntegerTy () ||
543543 !FinalValue->getType ()->isIntegerTy ()) {
544- LLVM_DEBUG (dbgs () << " [AGGREGATE] Non-integer loop bound.\n " );
544+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Non-integer loop bound.\n");
545545 break ;
546546 }
547547 auto Predicate = Bounds->getCanonicalPredicate ();
548548 if (!ICmpInst::isRelational (Predicate)) {
549- LLVM_DEBUG (dbgs () << " [AGGREGATE] Bad predicate.\n " );
549+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Bad predicate.\n");
550550 break ;
551551 }
552552 if (Bounds->getDirection () == Loop::LoopBounds::Direction::Unknown) {
553- LLVM_DEBUG (dbgs () << " [AGGREGATE] Unknown direction.\n " );
553+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Unknown direction.\n");
554554 break ;
555555 }
556556 auto LoopStep = cast<SCEVConstant>(
@@ -561,7 +561,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
561561 (ICmpInst::isGT (Predicate) || ICmpInst::isGE (Predicate)) ||
562562 Bounds->getDirection () == Loop::LoopBounds::Direction::Decreasing &&
563563 (ICmpInst::isLT (Predicate) || ICmpInst::isLE (Predicate))) {
564- LLVM_DEBUG (dbgs () << " [AGGREGATE] Unpredictable predicate.\n " );
564+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Unpredictable predicate.\n");
565565 break ;
566566 }
567567 if (Bounds->getDirection () == Loop::LoopBounds::Direction::Increasing) {
@@ -574,7 +574,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
574574 FinalSCEV = addSCEVAndCast (SE->getOne (FinalSCEV->getType ()),
575575 FinalSCEV, SE);
576576 }
577- LLVM_DEBUG (dbgs () << " [AGGREGATE] AddRecType: " ; C->getType ()->dump ());
577+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] AddRecType: "; C->getType()->dump());
578578 auto ZeroItr = evaluateAtIteration (C, SE->getZero (C->getType ()), SE);
579579 auto IdxExprStep = AddRecStep / LoopStep;
580580 /* LLVM_DEBUG(dbgs() << "[AGGREGATE] LoopStep: " << LoopStep <<
@@ -598,7 +598,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
598598 }
599599 auto CmpStartEnd = compareSCEVs (DimInfo.Start , DimInfo.End , SE);
600600 if (CmpStartEnd && *CmpStartEnd > 0 ) {
601- LLVM_DEBUG (dbgs () << " [AGGREGATE] Incorrect bounds.\n " );
601+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Incorrect bounds.\n");
602602 break ;
603603 }
604604 }
@@ -611,8 +611,8 @@ std::pair<MemoryLocationRange, bool> aggregate(
611611 getSExtValue () >= DimInfo.DimSize && DimensionN != 0 && N != nullptr ) {
612612 auto End = cast<SCEVConstant>(DimInfo.End )->getAPInt ().
613613 getSExtValue ();
614- LLVM_DEBUG (dbgs () << " [AGGREGATE] Array index out of bounds. End = " <<
615- End << " , DimSize = " << DimInfo.DimSize << " \n " );
614+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Array index out of bounds. End = " <<
615+ // End << ", DimSize = " << DimInfo.DimSize << "\n");
616616 break ;
617617 }
618618 ResLoc.DimList .push_back (DimInfo);
@@ -628,8 +628,8 @@ std::pair<MemoryLocationRange, bool> aggregate(
628628 ++DimensionN;
629629 }
630630 if (ResLoc.DimList .size () != ArrayPtr->getNumberOfDims ()) {
631- LLVM_DEBUG (dbgs () << " [AGGREGATE] Collapse incomplete location. Kind: "
632- << ResLoc.getKindAsString () << " \n " );
631+ // LLVM_DEBUG(dbgs() << "[AGGREGATE] Collapse incomplete location. Kind: "
632+ // << ResLoc.getKindAsString() << "\n");
633633 assert (ResLoc.Kind != LocKind::Collapsed &&
634634 " An incomplete array location cannot be of the `collapsed` kind!" );
635635 MemoryLocationRange NewLoc (Loc);
0 commit comments