Skip to content

Commit 6e92bcd

Browse files
committed
IROutliner: Do not look at use lists of constant phi inputs
Theoretically this does a worse job with globals but this is not covered by existing tests
1 parent 34bf25a commit 6e92bcd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/IPO/IROutliner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,8 @@ static void analyzeExitPHIsForOutputUses(
11261126
// outside of the single PHINode we should not skip over it.
11271127
for (unsigned Idx : IncomingVals) {
11281128
Value *V = PN.getIncomingValue(Idx);
1129-
if (outputHasNonPHI(V, Idx, PN, PotentialExitsFromRegion, RegionBlocks)) {
1129+
if (!isa<Constant>(V) &&
1130+
outputHasNonPHI(V, Idx, PN, PotentialExitsFromRegion, RegionBlocks)) {
11301131
OutputsWithNonPhiUses.insert(V);
11311132
OutputsReplacedByPHINode.erase(V);
11321133
continue;

0 commit comments

Comments
 (0)