Fix reduction group computation for MLIR emitter.
Fix reduction group computation for MLIR emitter.

Currently, there are cases where we duplicate reductions into more than 
one group. This essentially means the grouping is buggy, since the
goal is to share reads. I will only fix the grouping for the new
emitters, since I can't rule out that the current grouping is actually
better in some cases (and we need to validate the performance for the
new emitters anyway). See OneGroup in reduction_base_test for an
example.
