add optional refining (#69776)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69776
If we have an node output which is an optional type, but both if blocks produce a non-optional value, we can try to refine the if output type, which can open up further optimization opportunities.
Test Plan: Imported from OSS
Reviewed By: jbschlosser
Differential Revision: D33515235
Pulled By: eellison
fbshipit-source-id: 34f6ab94ac4238498f9db36a1b673c5d165e832e