[Mlir-commits] [mlir] [MLIR][NVVM] Return ISA compiler log via ObjectAttr properties (PR #176697)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Jan 18 22:36:42 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Target/LLVM/NVVM/Target.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index 1c0ccd6be..75e74bd3b 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -494,7 +494,7 @@ NVPTXSerializer::compileToBinary(StringRef ptxCode) {
return emitLogError("`ptxas`");
if (auto logBuffer = llvm::MemoryBuffer::getFile(logFile->first))
- isaCompilerLog = (*logBuffer)->getBuffer().str();
+ isaCompilerLog = (*logBuffer)->getBuffer().str();
#define DEBUG_TYPE "dump-sass"
LLVM_DEBUG({
std::optional<std::string> nvdisasm = findTool("nvdisasm");
@@ -621,7 +621,7 @@ NVPTXSerializer::compileToBinaryNVPTX(StringRef ptxCode) {
SmallVector<char, 0> binary(elfSize, 0);
RETURN_ON_NVPTXCOMPILER_ERROR(
nvPTXCompilerGetCompiledProgram(compiler, (void *)binary.data()));
-
+
RETURN_ON_NVPTXCOMPILER_ERROR(
nvPTXCompilerGetInfoLogSize(compiler, &logSize));
@@ -763,10 +763,10 @@ NVVMTargetAttrImpl::serializeToObject(Attribute attribute, Operation *module,
if (isaToBinaryTimeInMs.has_value())
module->setAttr("ISAToBinaryTimeInMs",
builder.getI64IntegerAttr(*isaToBinaryTimeInMs));
- StringRef isaCompilerLog = serializer.getCompilerLog();
- if (!isaCompilerLog.empty())
- module->setAttr("ISACompilerLog", builder.getStringAttr(isaCompilerLog));
-
+ StringRef isaCompilerLog = serializer.getCompilerLog();
+ if (!isaCompilerLog.empty())
+ module->setAttr("ISACompilerLog", builder.getStringAttr(isaCompilerLog));
+
return result;
}
@@ -796,7 +796,8 @@ NVVMTargetAttrImpl::createObject(Attribute attribute, Operation *module,
}
if (module->hasAttr("ISACompilerLog")) {
- StringAttr attr = llvm::dyn_cast<StringAttr>(module->getAttr("ISACompilerLog"));
+ StringAttr attr =
+ llvm::dyn_cast<StringAttr>(module->getAttr("ISACompilerLog"));
properties.push_back(builder.getNamedAttr("ISACompilerLog", attr));
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/176697
More information about the Mlir-commits
mailing list