[PATCH] D76961: [BranchFolder] don't remove MBB's that have their address taken

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 15:19:40 PDT 2020


nickdesaulniers added a comment.

In D76961#1950958 <https://reviews.llvm.org/D76961#1950958>, @efriedma wrote:

> > Ok, so I don't think this is generally the case, as we could have a MachineOperand to the INLINEASM_BR that is a blockaddress, yet is not a successor
>
> Even if there isn't any way to tell the difference from the INLINEASM_BR instruction at the moment, we could change that.


Yeah, we could technically make `asm goto` work even if you didn't use the `goto` part...

> 
> 
>> I honestly don't like blockaddresses and wonder if we could make these all just have BasicBlocks or MachineBasicBlocks as operands?
> 
> In general, blockaddress can refer to a block in a different function.  So for various reasons reasons, it makes sense to represent that as a "blockaddress".  It can't be an MBB because in general the MBB doesn't exist in memory.  That really only applies for indirectbr, though.
> 
> For INLINEASM_BR, we could use MachineBasicBlock operands to represent the succesors.

Maybe `blockaddress` `Constants` could be generated as late as possible. Instead, we'd pass `BasicBlock` operands around in the `Instruction` level IR, then lower to `MachineBasicBlock` operands at the `MachineInstr` level, then only generate `blockaddress` operands very late when lowering to `MCInst` level?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76961





More information about the llvm-commits mailing list