[PATCH] D106237: [ISel] Port AArch64 HADD and RHADD to ISel

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 7 08:26:55 PST 2021


dmgreen added a comment.

In D106237#3112542 <https://reviews.llvm.org/D106237#3112542>, @craig.topper wrote:

> Instead of making this part of SimplifyDemandedBits, could you emit (and (sext (hadds X, Y)), 0x7fffffff) for the (lshr (add (sext(X), sext(Y)), 1) case and let the AND be optimized by itself? Or would the transform not be profitable if it doesn't get removed?

Yeah that might work. Like https://alive2.llvm.org/ce/z/9pwKEi. I'll have to check if it looks worse anywhere - I think it should be fine in general, possibly minus the cost of materializing the constant.


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

https://reviews.llvm.org/D106237



More information about the llvm-commits mailing list