[llvm] [InstCombine] Don't sink freeze when the operand has other uses (PR #219110)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 03:53:20 PDT 2026
https://github.com/antoniofrighetto commented:
It looks freezeOtherUses() seems to exactly document the situation we are encountering here (invoke and a use in a PN):
https://github.com/llvm/llvm-project/blob/629b8198a3127f83118b06a2abc2a91e912e23e6/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp#L5342-L5347
I think we should probably check whether moving the freeze would actually dominate any use before performing the move (instead of optimistically moving the freeze first, and do the check later). In this case, the freeze can only be placed after the phi in `%join` (and it can never dominate the phi's use of `%p`).
https://github.com/llvm/llvm-project/pull/219110
More information about the llvm-commits
mailing list