[PATCH] D113437: [GlobalISel] Ensure that translateInvoke adds all successors for inlineasm

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 14:50:15 PST 2021


paquette created this revision.
paquette added reviewers: aemerson, arsenm, cynecx.
Herald added subscribers: hiraditya, rovka.
paquette requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

The existing code didn't add all necessary successors, which resulted in disjoint basic blocks. These would end up not being legalized which, in the best case, caused a fallback only in assert builds.

Here's an example:

https://godbolt.org/z/ndx15Enfj

We also end up getting weird codegen here as well.

Refactoring the code here allows us to correctly attach all successors. With this patch, the above example gives correct codegen at -O0 with and without asserts.

Also autogen the testcase to show that we add all the successors now.


https://reviews.llvm.org/D113437

Files:
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-unwind-inline-asm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113437.385637.patch
Type: text/x-patch
Size: 6945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211108/87c4dc41/attachment.bin>


More information about the llvm-commits mailing list