[PATCH] D78417: [SlotIndexes] Add insertion point for insertMBBIntoMaps

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 21 04:17:40 PDT 2020


critson added a comment.

In D78417#1993083 <https://reviews.llvm.org/D78417#1993083>, @kariddi wrote:

> I don't get completely what is the difference between this and just calling insertMBBInMaps() with the new block created by split as the argument. Shouldn't the insertion point being automatically devised correctly if the block is inserted in the right position?


I think the best way to describe the difference is that, at present, `insertMBBInMaps` inserts the block between //blocks//, but for splitting we need to the ability to insert the block between //instructions//.  When splitting a sequence of instructions which already have slot indexes, the block needs to come before a given instruction, rather than the next block (which is after the instructions in the new block).

An alternative implementation to the one in this patch would be to change `insertMBBInMaps` so that it checks if first instruction of the block being added has a slot index.  If so, then the block should go before that index, otherwise the current behaviour is maintained, i.e. for new empty blocks, or new blocks of new instructions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78417





More information about the llvm-commits mailing list