[llvm] [InstCombine] Allow freezing multiple out-of-loop values (PR #155638)
Cullen Rhodes via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 28 07:22:35 PDT 2025
c-rhodes wrote:
> Can you please add a test where the two start values come from the same predecessor (e.g. dummy br with both successors equal)? You need to be careful about that because the phi needs to have identical values for the same predecessor.
Perhaps I'm misunderstanding, but that's not legal IR? https://godbolt.org/z/8MYM1Yf5b
>
> By the way, this change isn't actually what I had in mind... I'd expect multiple starting values to get canonicalized away by loop simplify form. I think the more interesting extension here is the case where you need to freeze both the start value and the step value. So something like `{start,+,step}` where both values are not known non-poison.
ah ok, do you have an example test for this? Sounds like https://github.com/llvm/llvm-project/blob/33b2c26560f7083755fd0fabe1f74cddf02eb0a4/llvm/test/Transforms/InstCombine/freeze.ll#L855 but the flags get dropped there
https://github.com/llvm/llvm-project/pull/155638
More information about the llvm-commits
mailing list