D104143 introduced canonical value numbering between regions, which allows for the easy identification of items across a region, eliminating the need in the outliner to create parallel lists of instructions for each region, and replace output values in a less convoluted way,
I'd drop the Optional<> and use nullptr to represent "didn't find one". That removes ambiguity around Optional<Value*>(nullptr), and would improve the call sites.
... to fix the dereference after dyn_cast without checking it for null.
This looks okay with nits.
I think the commit message can be more descriptive here though. It should explain why you're changing behaviour surrounding PHIs/stores etc.
Seems like it's more appropriate to use cast here than dyn_cast, considering you assert right after.