[Mlir-commits] [mlir] [mlir][ptr] Add constantop convertion (PR #204846)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jun 19 10:05:45 PDT 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/Conversion/PtrToLLVM/PtrToLLVM.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/Conversion/PtrToLLVM/PtrToLLVM.cpp b/mlir/lib/Conversion/PtrToLLVM/PtrToLLVM.cpp
index fb9e92a36..cc1b3242c 100644
--- a/mlir/lib/Conversion/PtrToLLVM/PtrToLLVM.cpp
+++ b/mlir/lib/Conversion/PtrToLLVM/PtrToLLVM.cpp
@@ -397,7 +397,7 @@ LogicalResult ConstantOpConversion::matchAndRewrite(
if (isa<ptr::NullAttr>(value)) {
rewriter.replaceOpWithNewOp<LLVM::ZeroOp>(op, resultType);
return success();
- }
+ }
auto addrAttr = dyn_cast<ptr::AddressAttr>(value);
// Early-exit if unknown attribute.
if (!addrAttr) {
@@ -406,7 +406,7 @@ LogicalResult ConstantOpConversion::matchAndRewrite(
value.getAbstractAttribute().getName());
}
Type intType = rewriter.getIntegerType(addrAttr.getValue().getBitWidth());
- Value intConst = LLVM::ConstantOp::create(rewriter, op.getLoc(), intType,
+ Value intConst = LLVM::ConstantOp::create(rewriter, op.getLoc(), intType,
addrAttr.getValue());
rewriter.replaceOpWithNewOp<LLVM::IntToPtrOp>(op, resultType, intConst);
return success();
``````````
</details>
https://github.com/llvm/llvm-project/pull/204846
More information about the Mlir-commits
mailing list