[PATCH] D107883: [RISCV] Select vector mul by 2 to a vector add.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 11 09:22:12 PDT 2021


frasercrmck added a comment.

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

> DAGCombine should turn mul by 2 into shl. Except that it can't for scalable vectors because isKnownToBeAPowerOfTwo doesn't work for scalable vectors. We should just make DAG combine work even if we have just have to special case SPLAT_VECTOR.

Ah nice I missed that, maybe that explains why this patch doesn't test fixed-length vectors, because it's already done. Adding a check for `SPLAT_VECTOR` seems reasonable to me since it's already got one for `BUILD_VECTOR`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107883



More information about the llvm-commits mailing list