[PATCH] D158564: [RISCV] Fix assertion failure when zcmp extension is enabled.

Anmol P. Paralkar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 16:32:53 PDT 2023


anmolparalkar-nxp created this revision.
Herald added subscribers: jobnoorman, luke, sunshaoce, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
anmolparalkar-nxp requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, eopXD, MaskRay.
Herald added a project: LLVM.

Before accessing "getOpcode" thorugh machine instruction, check if the
iterator has reached the end of Machine basic block otherwise we will
crash at the assertion !NodePtr->isKnownSentinel().

      

The above assertion is hit in "Prologue/Epilogue Insertion & Frame
Finalization pass".

      

Merged in test case from D158379 <https://reviews.llvm.org/D158379>.


https://reviews.llvm.org/D158564

Files:
  llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
  llvm/test/CodeGen/RISCV/frame-lowering-crash.ll
  llvm/test/CodeGen/RISCV/prolog-epilog-crash.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158564.552531.patch
Type: text/x-patch
Size: 12076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230822/6d983f8d/attachment.bin>


More information about the llvm-commits mailing list