[PATCH] D119075: [DAGCombine][ARM] Custom lower smaller-than-legal MULH/AVG/ABD

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 11:03:17 PST 2022


efriedma added a comment.

I'd like to avoid target-specific custom lowering here, i.e. copy-pasting LowerBinopWithBitcast into every target.  A few possible alternatives.

1. Make the combine detect whatever pattern shows up after type legalization, and use the legal nodes.  Not sure how hard this is; I guess type legalization splits the nodes in ways that make it hard to detect the relevant pattern?
2. Shove something equivalent to LowerBinopWithBitcast directly into the relevant DAGCombines.  I guess the difficulty here is mostly that there isn't any target-independent equivalent to VECTOR_REG_CAST?
3. Teach type legalization to legalize these nodes, then make DAGCombine produce illegal nodes if it predicts the legalized result is cheap.  (Not sure this approach is best, though; "predicting" is sort of hard, and we don't really want to produce these nodes if they aren't going to lower to a single instruction.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119075/new/

https://reviews.llvm.org/D119075



More information about the llvm-commits mailing list