[PATCH] D79794: Change the INLINEASM_BR MachineInstr to be a non-terminating instruction.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 12:50:31 PDT 2021


MatzeB added a comment.

> We took great pains to ensure that nothing could be moved past it, so that the semantics won't change and we can reload registers, etc..

Yes, I see that this is going through great pain to ensure things still work. But this all feels to me like you are making a form of EBBs work here. There is a way to jump out of the basic block without having all instructions in it executed. There must be some cases where COPYs or SPILLs insructions end up after the branch now which brings us into this trouble.

- I realize that this was painful to model since LLVM was never prepared to have terminator instructions produce values. I guess we lack the time+expertise to fix this after the fact now :-(
- The design was already messed up before `INLINEASM_BR` for exception handling.

So I don't know what to do here except rant and predict random bugs popping up over the years because intuition about how basic blocks work is broken.

> Not being able to 100% model the control flow of an assembly block already existed with current assembly blocks. There's no guarantee that a given assembly block won't have branches, or loops, or calls, or exits. None of which is modeled in MIR.

Control flow within an assembly instruction is not a problem; Similar to a CALL instruction can also trigger arbitrary control flow, we can ignore that in the modeling since we have a guarnatee that control continues after the instruction eventually.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79794



More information about the llvm-commits mailing list