I don’t know if such a case currently exists upstream and don’t necessarily have time to look it up. Generally, I expect the burden of proof to be on whoever proposes a change.
If you suggest that patterns should not look beyond the root of the pattern, that sounds extremely restrictive for some cases. For example, if one wanted to rewrite select(cmpi) into a min/max, or basically anything that looks at getDefiningOp.
Can’t we just keep unrealized_conversion_cast, maybe with some additional annotation, and let the user rewrite those separately? FWIW, unrealized_conversion_cast did not exist when the materializations were first added, so one had to configure materializations.
One random comment. I remember several discussions around an operation-aware TypeConverter (as opposed to the current one that always returns the same converted type given original types). What’s your take on this?