[mlir] Match before rewrite in BubbleUpPackOpThroughGenericOp (#126946)
The BubbleUpPackOpThroughGenericOp pattern had some unsafe rewrites
happening before matching was fully complete, which causes the pattern
rewriter to fail to converge. This PR fixes the bug by moving all
matching logic to before the rewrite logic.
Signed-off-by: Max Dawkins <max.dawkins@gmail.com>