https://github.com/smithp35 approved this pull request. LGTM too. Checked that this fixes a problem with an internal example. Would be a possible candidate for cherry-picking to the 22 release. https://github.com/llvm/llvm-project/pull/187445