[PATCH] D156249: [RISCV] Implement getOptimalMemOpType for memcpy/memset lowering
Kito Cheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 19:16:59 PDT 2023
kito-cheng added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:17002-17009
+ // to byte aligned accesses.
+ if (PreferredVT != MVT::i8 && !Subtarget.enableUnalignedVectorMem()) {
+ if (Op.isFixedDstAlign() &&
+ PreferredVT.getStoreSize() > Op.getDstAlign().value())
+ PreferredVT = MVT::i8;
+ if (Op.isMemcpy() &&
+ PreferredVT.getStoreSize() > Op.getSrcAlign().value())
----------------
Just a minor optimization thought here, we might use i16 or i32 (on RV64) if alignment is OK?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156249/new/
https://reviews.llvm.org/D156249
More information about the llvm-commits
mailing list