The current implementation of g+g fusion on the migraphx side does not force any specific ordering of the second gemm's inputs. As a result, both of these will be sent to rocmlir:
gemm0 = (m, k) x (k, n) = (m, n)
gemm1 = (m, n ) x (n, n2) OR (m2, m) x (m, n)
(m2, m) x (m, n) should not be sent, at least as-is, to rocmlir. It either needs to not be matched, or a transpose needs to be inserted.