Skip to content

Commit fc8add9

Browse files
Add the predicate to the instrRepr before returning it when onlyAttachMLIRArgs=true (#4931)
The predicate wasn't being added to the instruction representation when `onlyAttachMLIRArgs` was set to true
1 parent 8fb7342 commit fc8add9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

third_party/nvidia/lib/TritonNVIDIAGPUToLLVM/PTXAsmFormat.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,20 @@ std::string PTXInstrExecution::dump() const {
172172
std::string osStr;
173173
llvm::raw_string_ostream os(osStr);
174174

175-
std::string instrRepr = strJoin(instr->instrParts, ".");
176-
if (onlyAttachMLIRArgs)
177-
return instrRepr;
178-
179175
if (pred) {
180176
if (!pred->repr)
181177
os << "@" << pred->dump() << " ";
182178
else
183179
os << pred->repr(pred->idx) << " ";
184180
}
185181

182+
std::string instrRepr = strJoin(instr->instrParts, ".");
183+
if (onlyAttachMLIRArgs) {
184+
os << instrRepr;
185+
os.flush();
186+
return osStr;
187+
}
188+
186189
llvm::SmallVector<std::string, 4> argReprs;
187190
for (auto *arg : argsInOrder) {
188191
argReprs.push_back(arg->dump());

0 commit comments

Comments
 (0)