[llvm] [IR] Update `PHINode::removeIncomingValueIf()` to use the swap strategy like `PHINode::removeIncomingValue()` (PR #172639)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 23 06:45:17 PST 2025
rj-jesus wrote:
I'm sorry if this is obvious, but is this swap generally correct? I think this works so long as Predicate is either value-based (using Idx to access the corresponding incoming value) or all incoming values to remove are last in Idx order. But, for example, if someone did `PN->removeIncomingValueIf([](unsigned Idx) { return Idx == 0; })` to remove only the first incoming value, I believe this would end up removing all incoming values of the Phi instead. Is this expected?
https://github.com/llvm/llvm-project/pull/172639
More information about the llvm-commits
mailing list