[IROutliner] Separate split PHI nodes from multiple exits by different outlinable...
authorAndrew Litteken <andrew.litteken@gmail.com>
Mon, 14 Mar 2022 04:45:09 +0000 (23:45 -0500)
committerAndrew Litteken <andrew.litteken@gmail.com>
Mon, 14 Mar 2022 19:56:59 +0000 (14:56 -0500)
commitc79ab1065e89872668b8d43c747ff3e5974b0d96
treefe6e40c41046df8cf893da3af4c95b08b72dc03a
parentaaca634c94c6dc6a18e07b4e33530cc1c07faeeb
[IROutliner] Separate split PHI nodes from multiple exits by different outlinable regions.

The IR Outliner is supposed to extract the outputs contained in an external phi node and place them into a phi node contained within the outlined function. However, when the output values of two outlined functions with two different output sets are contained within the same phi node, they are counted as the same exit path when first analyzed. In reality, these create two different phi nodes, creating an inconsistency, resulting in a mismatch in the expected number of output paths and a crash.  This fixes that counting when analyzing the outputs by also analyzing the incoming blocks rather than just the incoming values.

Reviewer: paquette

Differential Revision: https://reviews.llvm.org/D121313
llvm/lib/Transforms/IPO/IROutliner.cpp
llvm/test/Transforms/IROutliner/exit-block-phi-node-value-attribution.ll [new file with mode: 0644]