@@ -309,9 +309,11 @@ static unsigned getNumElems(unsigned Size, unsigned PartNumElems,
309309
310310#if !defined(NDEBUG)
311311/// 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 ) {
313313 std::string Result;
314314 raw_string_ostream OS(Result);
315+ if (Idx >= 0)
316+ OS << "Idx: " << Idx << ", ";
315317 OS << "n=" << VL.size() << " [" << *VL.front() << ", ..]";
316318 OS.flush();
317319 return Result;
@@ -10639,7 +10641,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
1063910641 // Some gather nodes might be absolutely the same as some vectorizable
1064010642 // nodes after reordering, need to handle it.
1064110643 LLVM_DEBUG(dbgs() << "SLP: Adding cost 0 for bundle "
10642- << shortBundleName(TE.Scalars) << ".\n"
10644+ << shortBundleName(TE.Scalars, TE.Idx ) << ".\n"
1064310645 << "SLP: Current total cost = " << Cost << "\n");
1064410646 continue;
1064510647 }
@@ -10648,7 +10650,7 @@ InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
1064810650 InstructionCost C = getEntryCost(&TE, VectorizedVals, CheckedExtracts);
1064910651 Cost += C;
1065010652 LLVM_DEBUG(dbgs() << "SLP: Adding cost " << C << " for bundle "
10651- << shortBundleName(TE.Scalars) << ".\n"
10653+ << shortBundleName(TE.Scalars, TE.Idx ) << ".\n"
1065210654 << "SLP: Current total cost = " << Cost << "\n");
1065310655 }
1065410656
@@ -12638,10 +12640,8 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
1263812640 Entries.front().front()->isSame(E->Scalars)) {
1263912641 // Perfect match in the graph, will reuse the previously vectorized
1264012642 // 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");
1264512645 // Restore the mask for previous partially matched values.
1264612646 Mask.resize(E->Scalars.size());
1264712647 const TreeEntry *FrontTE = Entries.front().front();
0 commit comments