Top-level ModuleOps cannot be transformed with the GreedyPatternRewriteDriver since D141945 because they do not have an enclosing region that could be used as a scope. Make the scope optional inside GreedyPatternRewriteDriver, so that top-level ops can be processed when they are on the initial list of ops.
Note: This does not allow users to bypass the scoping mechanism by setting config.scope = nullptr.
Technically you're doing more pointer chasing here aren't you? The op->getParentOp() will do some redundant traversal from op->getParentRegion().
This may very much not matter...