[Mlir-commits] [mlir] [MLIR] Add index bitwidth to the DataLayout (PR #85927)

Tobias Gysi llvmlistbot at llvm.org
Wed Mar 20 08:17:26 PDT 2024


================
@@ -57,6 +57,13 @@ uint64_t
 getDefaultPreferredAlignment(Type type, const DataLayout &dataLayout,
                              ArrayRef<DataLayoutEntryInterface> params);
 
+/// Default handler for the index bitwidth request. Computes the result for
+/// the built-in index type and dispatches to the DataLayoutTypeInterface for
+/// other types.
+std::optional<uint64_t>
+getDefaultIndexBitwidth(Type type, const DataLayout &dataLayout,
----------------
gysit wrote:

I believe optional makes sense for properties that are not available on all types. We use something similar (Attribute which can be null) for the other optional properties such as stack alignment. That way we do not depend on an interface.

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


More information about the Mlir-commits mailing list