[llvm] [DAGCombiner] Freeze maybe poison operands when folding select to logic (PR #84924)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 7 03:34:01 PDT 2024
nikic wrote:
> Maybe we should introduce ISD::LOGICAL_AND/ISD::LOGICAL_OR nodes to SelectionDAG? If we delay the lowering to actual AND/OR until operation legalization, we can do various combines without worrying about a bunch of extra freeze operations.
Yes, that would be an alternative -- this is essentially what we do in IR, though there we just keep the original select but recognize it as a logical and/or pattern. The advantage is that we don't have to introduce freeze -- the disadvantage is that we have to make sure that all optimizations can handle the logical variant. On the IR side, this took some very extensive work. Maybe it's simpler for SDAG as it presumably has less transforms reasoning about complex conditions.
https://github.com/llvm/llvm-project/pull/84924
More information about the llvm-commits
mailing list