[PATCH] D113442: [InstCombine] Enable fold select into operand for FAdd, FMul, FSub and FDiv.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 30 05:53:22 PST 2022


dmgreen added a comment.

For vectors - Arm MVE has to reverse these transforms (as in https://reviews.llvm.org/rGd9af9c2c5a53c9ba6aa0255240a2a40e8bea27aa). It is simpler in general to match `vselect cc, (add x, y), x)` as a predicated-add, than it is with a folded select with an identity element. But we do manage to reverse that at the moment, and I've not seen any cases of it folding to something we couldn't convert back. It can be quite important for performance in places, for example where the vectorizer produces a predicated reduction (https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp#L4158, that is only enabled for Arm MVE at the moment).

SVE doesn't seem to attempt to convert add+select into predicate-add yet. https://godbolt.org/z/TPbE95h5x


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113442



More information about the llvm-commits mailing list