[llvm] [DAG] visitFREEZE - always allow freezing multiple operands (PR #145939)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 13:26:08 PDT 2025


nikic wrote:

> This patch proposes we drop the opt-in limit for opcodes that are allowed to push a freeze through the op to freeze all its operands, bringing us more in line with how InstCombine handles pushing freeze through the tree to the roots.

This actually diverges from InstCombine, which only allows freezing one op.

> I'm struggling to find a strong reason for this limit apart from the DAG freeze handling being immature for so long - as we've improved coverage in canCreateUndefOrPoison/isGuaranteedNotToBeUndefOrPoison it looks like the regressions are not as severe.

The reason is basically to avoid increasing the amount of freezes. But overall we probably gain more from pushing freeze up the chain, even if it requires multiple freezes. I have been thinking about relaxing this in InstCombine as well.

https://github.com/llvm/llvm-project/pull/145939


More information about the llvm-commits mailing list