[PATCH] D82660: [RISCV] Optimize multiplication by specific immediates

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 08:44:44 PDT 2020


lenary added a comment.

Thanks for the patch!

This optimisation is done by DAGCombine if you instead implement `decomposeMulByConstant` in `RISCVTargetLowering`. Read the comment on the `TargetLoweringBase` class to understand how to use it. This is preferrable, because we don't want to maintain a target-specific copy of this optimisation if we can avoid it.

It would be sensible to base your implementation on the one in the x86 backend: `X86TargetLowering::decomposeMulByConstant`, which deals with some phase ordering issues around legalisation.


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

https://reviews.llvm.org/D82660





More information about the llvm-commits mailing list