[llvm] GVN: generalize impliesEquivalence (NFC) (PR #111416)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 9 06:35:30 PDT 2024


artagnon wrote:

> If we wanted to do the select fold, we'd do this in InstCombine rather than GVN. InstCombine already does this for integer comparisons, but not float comparisons.

Not sure what you mean, because InstCombine doesn't seem to work here: https://godbolt.org/z/5b36ccK9j. Proof: https://alive2.llvm.org/ce/z/Lr6jqc. If we change the `udiv` to an `add`, InstCombine has some special code for folding select-icmp-and-add. Is it within the scope of InstCombine to do GVN-like replacements, and not really "combine" or "fold" anything?

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


More information about the llvm-commits mailing list