[llvm] [CorrelatedValuePropagation] Run CVP before first SimplifyCFG (PR #141125)
Florian Mayer via llvm-commits
llvm-commits at lists.llvm.org
Thu May 22 19:48:47 PDT 2025
fmayer wrote:
> TBH, I don't want to add a pass into the optimization pipeline to just address your original issue, unless it demonstrates significant improvements on real-world applications.
>
> For the motivating case, the context-sensitive range analysis is blocked by the `isGuaranteedNotToBeUndef` check:
>
> https://github.com/llvm/llvm-project/blob/b79a624cd601723f9e55a7b1bad9fbaa060d803e/llvm/lib/Analysis/LazyValueInfo.cpp#L869-L884
>
> Godbolt: https://godbolt.org/z/MjKnP14Y5 However, I believe this can be improved by recognizing some simple patterns, as Alive2 shows the transformation is correct, even without `noundef` on `%x`: https://alive2.llvm.org/ce/z/DFV_kR
Oh, interesting; thanks. I incorrectly traced this to `CorrelatedValuePropagation`'s logic for select.
https://github.com/llvm/llvm-project/pull/141125
More information about the llvm-commits
mailing list