From 5bc3cb4d18271eb1a21a8b6bb11792766a65afd6 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Wed, 12 Feb 2025 06:14:11 -0800 Subject: [PATCH] [SLP][NFC]Improve dump of the ScheduleData, NFC --- .../Transforms/Vectorize/SLPVectorizer.cpp | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index fb1054ee30aab..c72d3579e1aa3 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -3997,23 +3997,29 @@ class BoUpSLP { return Sum; } - void dump(raw_ostream &os) const { - if (!isSchedulingEntity()) { - os << "/ " << *Inst; - } else if (NextInBundle) { - os << '[' << *Inst; + void dump(raw_ostream &OS) const { + if (isPartOfBundle()) { + if (!isSchedulingEntity()) { + OS << "/ " << *Inst << ", part of "; + FirstInBundle->dump(OS); + return; + } + OS << '[' << *Inst; ScheduleData *SD = NextInBundle; while (SD) { - os << ';' << *SD->Inst; + OS << ';' << *SD->Inst; SD = SD->NextInBundle; } - os << ']'; + OS << ']'; } else { - os << *Inst; + OS << *Inst; } } - LLVM_DUMP_METHOD void dump() const { dump(dbgs()); } + LLVM_DUMP_METHOD void dump() const { + dump(dbgs()); + dbgs() << '\n'; + } Instruction *Inst = nullptr;