[PATCH] D126278: [RISCV] Replace untested code with assert

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 21:11:44 PDT 2022


frasercrmck updated this revision to Diff 431873.
frasercrmck added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126278

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp


Index: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
@@ -757,8 +757,7 @@
     // objects to the required alignment.
     if (MFI.getStackID(FI) == TargetStackID::Default) {
       Offset += StackOffset::getFixed(MFI.getStackSize());
-      if (FI < 0)
-        Offset += StackOffset::getFixed(RVFI->getLibCallStackSize());
+      assert(FI >= 0 && "Unhandled negative frame index");
     } else if (MFI.getStackID(FI) == TargetStackID::ScalableVector) {
       // Ensure the base of the RVV stack is correctly aligned: add on the
       // alignment padding.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126278.431873.patch
Type: text/x-patch
Size: 724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220525/dc378298/attachment.bin>


More information about the llvm-commits mailing list