[llvm] [CorrelatedValuePropagation] Run CVP before first SimplifyCFG (PR #141125)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Thu May 22 19:04:37 PDT 2025
https://github.com/dtcxzyw commented:
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
https://github.com/llvm/llvm-project/pull/141125
More information about the llvm-commits
mailing list