@@ -309,9 +309,11 @@ static unsigned getNumElems(unsigned Size, unsigned PartNumElems,
309
309
310
310
#if !defined(NDEBUG)
311
311
/// Print a short descriptor of the instruction bundle suitable for debug output.
312
- static std::string shortBundleName(ArrayRef<Value *> VL) {
312
+ static std::string shortBundleName(ArrayRef<Value *> VL, int Idx = -1 ) {
313
313
std::string Result;
314
314
raw_string_ostream OS(Result);
315
+ if (Idx >= 0)
316
+ OS << "Idx: " << Idx << ", ";
315
317
OS << "n=" << VL.size() << " [" << *VL.front() << ", ..]";
316
318
OS.flush();
317
319
return Result;
@@ -10639,7 +10641,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
10639
10641
// Some gather nodes might be absolutely the same as some vectorizable
10640
10642
// nodes after reordering, need to handle it.
10641
10643
LLVM_DEBUG(dbgs() << "SLP: Adding cost 0 for bundle "
10642
- << shortBundleName(TE.Scalars) << ".\n"
10644
+ << shortBundleName(TE.Scalars, TE.Idx ) << ".\n"
10643
10645
<< "SLP: Current total cost = " << Cost << "\n");
10644
10646
continue;
10645
10647
}
@@ -10648,7 +10650,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
10648
10650
InstructionCost C = getEntryCost(&TE, VectorizedVals, CheckedExtracts);
10649
10651
Cost += C;
10650
10652
LLVM_DEBUG(dbgs() << "SLP: Adding cost " << C << " for bundle "
10651
- << shortBundleName(TE.Scalars) << ".\n"
10653
+ << shortBundleName(TE.Scalars, TE.Idx ) << ".\n"
10652
10654
<< "SLP: Current total cost = " << Cost << "\n");
10653
10655
}
10654
10656
@@ -12638,10 +12640,8 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
12638
12640
Entries.front().front()->isSame(E->Scalars)) {
12639
12641
// Perfect match in the graph, will reuse the previously vectorized
12640
12642
// node. Cost is 0.
12641
- LLVM_DEBUG(
12642
- dbgs()
12643
- << "SLP: perfect diamond match for gather bundle "
12644
- << shortBundleName(E->Scalars) << ".\n");
12643
+ LLVM_DEBUG(dbgs() << "SLP: perfect diamond match for gather bundle "
12644
+ << shortBundleName(E->Scalars, E->Idx) << ".\n");
12645
12645
// Restore the mask for previous partially matched values.
12646
12646
Mask.resize(E->Scalars.size());
12647
12647
const TreeEntry *FrontTE = Entries.front().front();
0 commit comments