@@ -938,7 +938,7 @@ class StackAllocationPromoter {
938
938
939
939
private:
940
940
// / Promote AllocStacks into SSA.
941
- void promoteAllocationToPhi ();
941
+ void promoteAllocationToPhi (BlockSetVector &livePhiBlocks );
942
942
943
943
// / Replace the dummy nodes with new block arguments.
944
944
void addBlockArguments (BlockSetVector &phiBlocks);
@@ -1685,7 +1685,8 @@ void StackAllocationPromoter::pruneAllocStackUsage() {
1685
1685
LLVM_DEBUG (llvm::dbgs () << " *** Finished pruning : " << *asi);
1686
1686
}
1687
1687
1688
- void StackAllocationPromoter::promoteAllocationToPhi () {
1688
+ void StackAllocationPromoter::promoteAllocationToPhi (
1689
+ BlockSetVector &livePhiBlocks) {
1689
1690
LLVM_DEBUG (llvm::dbgs () << " *** Placing Phis for : " << *asi);
1690
1691
1691
1692
// A list of blocks that will require new Phi values.
@@ -1781,10 +1782,6 @@ void StackAllocationPromoter::promoteAllocationToPhi() {
1781
1782
// Replace the dummy values with new block arguments.
1782
1783
addBlockArguments (phiBlocks);
1783
1784
1784
- // The blocks which still have new phis after fixBranchesAndUses runs. These
1785
- // are not necessarily the same as phiBlocks because fixBranchesAndUses
1786
- // removes superfluous proactive phis.
1787
- BlockSetVector livePhiBlocks (asi->getFunction ());
1788
1785
// Hook up the Phi nodes, loads, and debug_value_addr with incoming values.
1789
1786
fixBranchesAndUses (phiBlocks, livePhiBlocks);
1790
1787
@@ -1801,8 +1798,13 @@ void StackAllocationPromoter::run() {
1801
1798
// per block and the last store is recorded.
1802
1799
pruneAllocStackUsage ();
1803
1800
1801
+ // The blocks which still have new phis after fixBranchesAndUses runs. These
1802
+ // are not necessarily the same as phiBlocks because fixBranchesAndUses
1803
+ // removes superfluous proactive phis.
1804
+ BlockSetVector livePhiBlocks (asi->getFunction ());
1805
+
1804
1806
// Replace AllocStacks with Phi-nodes.
1805
- promoteAllocationToPhi ();
1807
+ promoteAllocationToPhi (livePhiBlocks );
1806
1808
1807
1809
// Make sure that all of the allocations were promoted into registers.
1808
1810
assert (isWriteOnlyAllocation (asi) && " Non-write uses left behind" );
0 commit comments