[llvm] (Draft) [DAG] Combine icmps into subo_carry (PR #106291)

Robert Dazi via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 07:22:18 PDT 2024


v01dXYZ wrote:

I don't know enough LLVM to have a good opinion if it is better to put it in `CGP` or in `DAGCombiner`. I guess there are other DAG combines that could be implemented at `CGP` too. I'm a little confuse by that, so I prefer to follow your guidelines.

* I will add a guard to only combine for `BeforeLegalTypes`. 
* I could create another PR for `CGP` that will revert the `icmp + logic` to a three `subo`. We would need to check for the availability of a `SUBO_CARRY` instruction as replacing the icmps (and logic operations) by three `subo` don't seem at first glance a win for all targets.


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


More information about the llvm-commits mailing list