[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Fix missing source materialization (PR #97903)

Markus Böck llvmlistbot at llvm.org
Sun Jul 7 06:59:53 PDT 2024


================
@@ -2865,6 +2860,8 @@ static LogicalResult legalizeUnresolvedMaterialization(
       break;
     }
     if (newMaterialization) {
+      assert(newMaterialization.getType() == opResult.getType() &&
+             "materialization callback produced value of incorrect type");
----------------
zero9178 wrote:

Assuming this assert might be hit more often now, it might be worth duplicating it into the respective switch cases so that we can give a better error message such as 
`"value returned by argument materialization expected to in the source type system"` that are more actionable

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


More information about the Mlir-commits mailing list