Skip to content

Commit 61ad3de

Browse files
[MCA] Fix formatting
1 parent aa94f41 commit 61ad3de

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

llvm/tools/llvm-mca/Views/InstructionInfoView.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace llvm {
2020
namespace mca {
2121

2222
void InstructionInfoView::getComment(const MCInst &MCI,
23-
std::string &CommentString) const {
23+
std::string &CommentString) const {
2424
StringRef s = MCI.getLoc().getPointer();
2525
std::string InstrStr;
2626
size_t pos = 0, pos_cmt = 0;
@@ -143,11 +143,11 @@ void InstructionInfoView::printView(raw_ostream &OS) const {
143143

144144
if (PrintSchedulingInfo) {
145145
if (PrintEncodings)
146-
WithColor::warning()
147-
<< "No encodings printed when -scheduling-info option enabled.\n";
146+
WithColor::warning()
147+
<< "No encodings printed when -scheduling-info option enabled.\n";
148148
if (PrintBarriers)
149-
WithColor::warning()
150-
<< "No barrier printed when -scheduling-info option enabled.\n";
149+
WithColor::warning()
150+
<< "No barrier printed when -scheduling-info option enabled.\n";
151151

152152
printSchedulingInfoView(OS);
153153
return;
@@ -269,27 +269,28 @@ void InstructionInfoView::collectData(
269269
if (PrintSchedulingInfo) {
270270
// Get latency with bypass
271271
IIVDEntry.Bypass =
272-
IIVDEntry.Latency - MCSchedModel::getBypassDelayCycles(STI, SCDesc);
272+
IIVDEntry.Latency - MCSchedModel::getBypassDelayCycles(STI, SCDesc);
273273
IIVDEntry.OpcodeName = (std::string)MCII.getName(Inst.getOpcode());
274274
raw_string_ostream TempStream(IIVDEntry.Resources);
275275
const MCWriteProcResEntry *Index = STI.getWriteProcResBegin(&SCDesc);
276276
const MCWriteProcResEntry *Last = STI.getWriteProcResEnd(&SCDesc);
277277
auto sep = "";
278278
for (; Index != Last; ++Index) {
279-
if (!Index->ReleaseAtCycle)
280-
continue;
281-
const MCProcResourceDesc *MCProc =
282-
SM.getProcResource(Index->ProcResourceIdx);
283-
if (Index->ReleaseAtCycle > 1) {
284-
// Output ReleaseAtCycle between [] if not 1 (default)
285-
// This is to be able to evaluate throughput.
286-
// See getReciprocalThroughput in MCSchedule.cpp
287-
// TODO: report AcquireAtCycle to check this scheduling info.
288-
TempStream << sep << format("%s[%d]", MCProc->Name, Index->ReleaseAtCycle);
289-
} else {
290-
TempStream << sep << format("%s", MCProc->Name);
291-
}
292-
sep = ",";
279+
if (!Index->ReleaseAtCycle)
280+
continue;
281+
const MCProcResourceDesc *MCProc =
282+
SM.getProcResource(Index->ProcResourceIdx);
283+
if (Index->ReleaseAtCycle > 1) {
284+
// Output ReleaseAtCycle between [] if not 1 (default)
285+
// This is to be able to evaluate throughput.
286+
// See getReciprocalThroughput in MCSchedule.cpp
287+
// TODO: report AcquireAtCycle to check this scheduling info.
288+
TempStream << sep
289+
<< format("%s[%d]", MCProc->Name, Index->ReleaseAtCycle);
290+
} else {
291+
TempStream << sep << format("%s", MCProc->Name);
292+
}
293+
sep = ",";
293294
}
294295
TempStream.flush();
295296
}

llvm/tools/llvm-mca/Views/InstructionInfoView.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ class InstructionInfoView : public InstructionView {
9595
llvm::MCInstPrinter &IP,
9696
ArrayRef<UniqueInst> LoweredInsts,
9797
bool ShouldPrintBarriers, bool ShouldPrintSchedulingInfo,
98-
const InstrumentManager &IM,
99-
const InstToInstrumentsT &InstToInstruments)
98+
const InstrumentManager &IM,
99+
const InstToInstrumentsT &InstToInstruments)
100100
: InstructionView(ST, IP, S), MCII(II), CE(C),
101101
PrintEncodings(ShouldPrintEncodings),
102102
PrintBarriers(ShouldPrintBarriers),
103-
PrintSchedulingInfo(ShouldPrintSchedulingInfo),
104-
LoweredInsts(LoweredInsts), IM(IM),
105-
InstToInstruments(InstToInstruments) {}
103+
PrintSchedulingInfo(ShouldPrintSchedulingInfo),
104+
LoweredInsts(LoweredInsts), IM(IM),
105+
InstToInstruments(InstToInstruments) {}
106106

107107
void printView(llvm::raw_ostream &OS) const override;
108108
StringRef getNameAsString() const override { return "InstructionInfoView"; }

0 commit comments

Comments
 (0)