Many of the sets of output stores will be the same. When a block is created, we check if there is an output block with the same set of store instructions. If there is, we map the output block of the region back to the block, so that the extra argument controlling the switch statement can be set to the appropriate block value.
Test:
- llvm/test/Transforms/IROutliner/outlining-same-output-blocks.ll
Can you elaborate some more on the comment about DenseMap?