[IROutliner] Fix phi nodes when self referential within block but doesn't contain...
authorAndrew Litteken <andrew.litteken@gmail.com>
Mon, 21 Mar 2022 15:18:24 +0000 (10:18 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Mon, 21 Mar 2022 16:05:15 +0000 (11:05 -0500)
commit4e500df89ec6104771699dbf674afa982d5c672e
tree69fdbc860ad4acf8c898ebf04ac8ee6059b7377f
parent2ed030ba88f98e7e8a8fc1ae5c8b6964fb230bb9
[IROutliner] Fix phi nodes when self referential within block but doesn't contain branch

When outlining a phi node, if the the incoming branch is a block contained in the region and the branch from that block is not outlined, we create broken code. The fix is to recognize when that branch from the included incoming block is not contained, and ignore the region.

Reviewer: paquette

Differential Revision: https://reviews.llvm.org/D121311
llvm/lib/Transforms/IPO/IROutliner.cpp
llvm/test/Transforms/IROutliner/phi-nodes-parent-block-referential.ll [new file with mode: 0644]