[MLIR] Fix crash in alias printer when encountering null operands (#188581)
When the IR contains operations with null operand values, the
DummyAliasOperationPrinter used during alias collection crashed when
iterating over operand types via op->getOperandTypes(), because
ValueTypeIterator::mapElement calls value.getType() on each operand,
which dereferences null for a null Value.
Fix the crash by:
1. Iterating over operand values directly in printGenericOp, skipping
any null operands.
2. Adding a null-type guard in printType so that null types are silently
skipped.
3. Adding a null-type guard at the top of printAndVisitNestedAliasesImpl
to avoid crashing when visiting sub-elements of a null type.
The test requires using --mlir-very-unsafe-disable-verifier-on-parsing
to construct the invalid IR.
Fixes #182747
Assisted-by: Claude Code