[Mlir-commits] [mlir] Update MLIR to support nusw and nuw in GEP. (PR #137272)

Krzysztof Drewniak llvmlistbot at llvm.org
Fri Apr 25 07:34:22 PDT 2025


================
@@ -303,8 +303,10 @@ def LLVM_GEPOp : LLVM_Op<"getelementptr", [Pure,
     as indices. In the case of indexing within a structure, it is required to
     either use constant indices directly, or supply a constant SSA value.
 
-    An optional 'inbounds' attribute specifies the low-level pointer arithmetic
+    Optional attributes can be used to specify the low-level pointer arithmetic
     overflow behavior that LLVM uses after lowering the operation to LLVM IR.
+    The acceptable attributes could be one of or the combination of 'inbounds',
+    'nusw' or 'nuw'.
----------------
krzysz00 wrote:

I think we need a verifier somewhere (probably on the property or on the op) to catch inbounds_flag without nusw 

Currently, I think that combination goes to an LLVM assertion in the translator

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


More information about the Mlir-commits mailing list