Separate structuralize pass logic to handle two cases:
Rewrite as generic version
Handle very simple custom versions
Other custom versions will be left unchanged and will need to be
handled by another lowering pass which only looks for those specific
custom versions.
For example, ReduceToVector in the structuralize pass doesn't handle custom aggregators (count, argmin, first, etc). All it does is convert non-custom aggregators into ReduceToVectorGeneric. The normal lowering pass will then handle the generic version and separately the custom version.
All DWIM checks are now handled exclusively by the structuralize pass.
Separate structuralize pass logic to handle two cases:
Other custom versions will be left unchanged and will need to be handled by another lowering pass which only looks for those specific custom versions.
For example,
ReduceToVector
in the structuralize pass doesn't handle custom aggregators (count, argmin, first, etc). All it does is convert non-custom aggregators into ReduceToVectorGeneric. The normal lowering pass will then handle the generic version and separately the custom version.All DWIM checks are now handled exclusively by the structuralize pass.