[Mlir-commits] [mlir] [mlir][ptr] Add the `ptradd` and `type_offset` ops, and `int_space` attr (PR #136434)
Tobias Gysi
llvmlistbot at llvm.org
Mon Apr 21 02:31:52 PDT 2025
================
@@ -0,0 +1,15 @@
+// RUN: mlir-opt --canonicalize %s | FileCheck %s
+
+/// Check `ptr_add` canonicalizer patterns.
+
+// CHECK-LABEL: @ops0
+func.func @ops0(%ptr: !ptr.ptr<#ptr.generic_space>) -> !ptr.ptr<#ptr.generic_space> {
+ // CHECK: (%[[PTR_0:.*]]: !ptr.ptr<#ptr.generic_space>)
----------------
gysit wrote:
```suggestion
// CHECK-LABEL: @zero_offset
// CHECK-SAME: (%[[PTR_0:.*]]: !ptr.ptr<#ptr.generic_space>)
func.func @zero_offset(%ptr: !ptr.ptr<#ptr.generic_space>) -> !ptr.ptr<#ptr.generic_space> {
```
ultra nit: I would use a more descriptive test name (and I like to move the argument check-line above the function.
https://github.com/llvm/llvm-project/pull/136434
More information about the Mlir-commits
mailing list