[Mlir-commits] [mlir] [mlir][drr] Fix getValueAndRangeUse for Optional operands (PR #138742)

Maksim Levental llvmlistbot at llvm.org
Tue May 13 00:33:21 PDT 2025


================
@@ -303,6 +303,12 @@ std::string SymbolInfoMap::SymbolInfo::getValueAndRangeUse(
   case Kind::Operand: {
     assert(index < 0);
     auto *operand = cast<NamedTypeConstraint *>(op->getArg(getArgIndex()));
+    if (operand->isOptional()) {
+      auto repl =
+          formatv(fmt, formatv("({0}.empty() ? Value() : *{0}.begin())", name));
----------------
makslevental wrote:

Nah there's no rule like that. If you send a PR with the proper namespacing I'll stamp/merge it (or I can send it tomorrow)

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


More information about the Mlir-commits mailing list