@@ -244,11 +244,9 @@ static void interChangeDependencies(CharMatrix &DepMatrix, unsigned FromIndx,
244
244
// [Theorem] A permutation of the loops in a perfect nest is legal if and only
245
245
// if the direction matrix, after the same permutation is applied to its
246
246
// columns, has no ">" direction as the leftmost non-"=" direction in any row.
247
- static std::optional<bool > isLexicographicallyPositive (std::vector<char > &DV,
248
- unsigned Begin,
249
- unsigned End) {
250
- ArrayRef<char > DVRef (DV);
251
- for (unsigned char Direction : DVRef.slice (Begin, End - Begin)) {
247
+ static std::optional<bool >
248
+ isLexicographicallyPositive (ArrayRef<char > DV, unsigned Begin, unsigned End) {
249
+ for (unsigned char Direction : DV.slice (Begin, End - Begin)) {
252
250
if (Direction == ' <' )
253
251
return true ;
254
252
if (Direction == ' >' || Direction == ' *' )
@@ -309,18 +307,18 @@ static void populateWorklist(Loop &L, LoopVector &LoopList) {
309
307
LoopList.push_back (CurrentLoop);
310
308
}
311
309
312
- static bool hasSupportedLoopDepth (SmallVectorImpl <Loop *> & LoopList,
310
+ static bool hasSupportedLoopDepth (ArrayRef <Loop *> LoopList,
313
311
OptimizationRemarkEmitter &ORE) {
314
312
unsigned LoopNestDepth = LoopList.size ();
315
313
if (LoopNestDepth < MinLoopNestDepth || LoopNestDepth > MaxLoopNestDepth) {
316
314
LLVM_DEBUG (dbgs () << " Unsupported depth of loop nest " << LoopNestDepth
317
315
<< " , the supported range is [" << MinLoopNestDepth
318
316
<< " , " << MaxLoopNestDepth << " ].\n " );
319
- Loop ** OuterLoop = LoopList.begin ();
317
+ Loop *OuterLoop = LoopList.front ();
320
318
ORE.emit ([&]() {
321
319
return OptimizationRemarkMissed (DEBUG_TYPE, " UnsupportedLoopNestDepth" ,
322
- (* OuterLoop) ->getStartLoc (),
323
- (* OuterLoop) ->getHeader ())
320
+ OuterLoop->getStartLoc (),
321
+ OuterLoop->getHeader ())
324
322
<< " Unsupported depth of loop nest, the supported range is ["
325
323
<< std::to_string (MinLoopNestDepth) << " , "
326
324
<< std::to_string (MaxLoopNestDepth) << " ].\n " ;
@@ -377,7 +375,7 @@ class LoopInterchangeLegality {
377
375
return OuterInnerReductions;
378
376
}
379
377
380
- const SmallVectorImpl <PHINode *> & getInnerLoopInductions () const {
378
+ const ArrayRef <PHINode *> getInnerLoopInductions () const {
381
379
return InnerLoopInductions;
382
380
}
383
381
0 commit comments