[PATCH] D129948: [RISCV] Fold stack reload into sext.w by using lw instead of ld.

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 02:43:46 PDT 2022


asb added a comment.

Good thought re big-endian. This looks good to me, modulo tweaking the comment as Fraser suggested.



================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfo.cpp:652
+
+  // Fold sext.w+load from stack to lw.
+  // TODO: Fold with sext.b, sext.h, zext.b, zext.h, zext.w?
----------------
frasercrmck wrote:
> Maybe it's just me but I read "sext.w+load" the other way round than it's intended here. Maybe I'm interpreting "+" as "followed-by"?
You're right, load+sext.w would seem clearer. Or maybe just use S-expressions to remove any ambiguity.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129948



More information about the llvm-commits mailing list