[PATCH] D130290: [MachineVerifier] add checks for INLINEASM_BR

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 10:21:27 PDT 2022


nickdesaulniers created this revision.
nickdesaulniers added reviewers: nikic, efriedma, jyknight, void, arsenm.
Herald added a subscriber: hiraditya.
Herald added a project: All.
nickdesaulniers requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Test for a case we observed after the initial implementation of D129997 <https://reviews.llvm.org/D129997>
landed, in which case we observed a crash while building the ppc64le
Linux kernel. In that case, we had one block with two exits, both to the
same successor. Removing one of the exits corrupted the
successor/predecessor lists.

So when we have an INLINEASM_BR, check a few things for each indirect
target:

1. that it exists.
2. that it is listed in our successors.
3. that its predecessor list contains the parent MBB of INLINEASM_BR.

This would have caught the regression discovered after D129997 <https://reviews.llvm.org/D129997> landed,
after the pass that was problematic (early-tailduplication) rather than
getting a stack trace in a later pass (regalloc) that doesn't understand
the anomaly and crashes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130290

Files:
  llvm/lib/CodeGen/MachineVerifier.cpp
  llvm/test/MachineVerifier/verify-inlineasmbr.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130290.446558.patch
Type: text/x-patch
Size: 8740 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220721/f1cdb5af/attachment.bin>


More information about the llvm-commits mailing list