This adds all the support for top-down traversals and constant prefolding that was
reverted in this patch:
https://reviews.llvm.org/D99329
This has two changes from the previous patch:
- It disables the 'processExistingConstants' prefolding call when doing a bottom-up traversal.
- It defaults applyPatternsAndFoldGreedily to bottom-up traversal instead of top-down.
The consequence of these two changes is that there is *no behavior change* from this
patch. We can stage in the new behavior on a case by case basis over time.
Wouldn't DialectFoldInterface::shouldMaterializeInto affect where these get moved to rather than always to entry?