[PATCH] D82660: [RISCV] Optimize multiplication by specific immediates
Sam Elliott via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 7 01:18:00 PDT 2020
lenary added a comment.
One issue, then I'm happy.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2990
+ if (auto *ConstNode = dyn_cast<ConstantSDNode>(C.getNode())) {
+ int64_t Imm = ConstNode->getSExtValue();
+ if (isPowerOf2_64(Imm + 1) || isPowerOf2_64(Imm - 1) ||
----------------
getSExtValue will assert if the value does not fit into 64 bits - you need to do a check before you get there.
I think this hook can be called before legalisation, so you may not get only legal types in this call.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82660/new/
https://reviews.llvm.org/D82660
More information about the llvm-commits
mailing list