[PATCH] D61884: [RISCV] Support stack offset exceed 32-bit for RV64

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 08:11:19 PDT 2019


lenary added a comment.

Thanks for the patch! I have two comments, which I think will help improve this patch.



================
Comment at: lib/Target/RISCV/RISCVFrameLowering.cpp:88
+    } else {
+      TII->movImm64(MBB, MBBI, DL, ScratchReg, Val, Flag);
+    }
----------------
I think you can probably get rid of `movImm32`, and only use movImm64 (the logic in `generateInstSeq` covers 32-bit operands), which I think will address the TODO in `movImm32`.

Then my only worry would be how we error when we need a larger-than-32-bit offset on RISC-V 32, which would probably cause errors somewhere way before this code anyway.


================
Comment at: test/CodeGen/RISCV/rv64-large-stack.ll:42
+entry:
+  %w = alloca [100000000 x { fp128, fp128 }], align 16
+  %0 = bitcast [100000000 x { fp128, fp128 }]* %w to i8*
----------------
I think this test case can be significantly simplified. You should just need a single alloca, and then maybe a call that uses a pointer into the alloca?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61884





More information about the llvm-commits mailing list