[Mlir-commits] [mlir] [mlir] NFC: Clarify documentation on InferShapedTypeOpInterface::inferReturnTypeComponents (PR #70350)

Mehdi Amini llvmlistbot at llvm.org
Fri Oct 27 11:38:48 PDT 2023


================
@@ -142,6 +142,9 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
       Unknown (e.g., unranked) shape and nullptrs for element type and attribute
       may be returned by this function while returning success. E.g., partial
       population of components is not error condition.
+
+      Be aware that this method is supposed to be called with valid arguments,
+      e.g., operands are verified, or it may result in an undefined behavior.
----------------
joker-eph wrote:

The Builder API is a different story, we can expect a builder call from a pass to not be incorrect, that's a general approach in MLIR (it's not just about Builder, but any kind of transformation, and also Builder is not an API that is allowed to fail, so the client must provide correct arguments).

The "valid IR" thing is really about the verifier to me, either we can guarantee things that are verified, or we should treat the input as "unsafe" (which is the case here).



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


More information about the Mlir-commits mailing list