[Mlir-commits] [mlir] [mlir][LLVM] Add nsw and nuw flags (PR #74508)

Tobias Gysi llvmlistbot at llvm.org
Tue Dec 5 12:57:51 PST 2023


================
@@ -0,0 +1,14 @@
+// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
+
+// CHECK-LABEL: define void @intflags_func
+llvm.func @intflags_func(%arg0: i64, %arg1: i64) {
+  // CHECK: %{{.*}} = add nsw i64 %{{.*}}, %{{.*}}
+  %0 = llvm.add %arg0, %arg1 flags <nsw> : i64
----------------
gysit wrote:

```suggestion
  %0 = llvm.add %arg0, %arg1 overflow<nsw> : i64
```
ultra nit: What do you think about dropping the space and maybe use a slightly more specific name? I guess it depends if we choose to do the rename.

https://github.com/llvm/llvm-project/pull/74508


More information about the Mlir-commits mailing list