Skip to content

Commit 4967614

Browse files
committed
[Mem2Reg] NFC: Fixed comments.
Corrected the comments describing what the `promoteSingleBlockAllocation` and `promoteMultiBlockAllocation` functions do since they were no longer accurate.
1 parent e321fc4 commit 4967614

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,15 +1918,18 @@ class MemoryToRegisters {
19181918
return *domTreeLevels;
19191919
}
19201920

1921-
/// Promote all of the AllocStacks in a single basic block in one
1922-
/// linear scan. Note: This function deletes all of the users of the
1923-
/// AllocStackInst, including the DeallocStackInst but it does not remove the
1924-
/// AllocStackInst itself!
1921+
/// Promote the specified stack location whose uses are all within a single
1922+
/// block.
1923+
///
1924+
/// Note: Deletes all of the users of the alloc_stack, including the
1925+
/// dealloc_stack but it does not remove the alloc_stack itself.
19251926
void removeSingleBlockAllocation(AllocStackInst *asi);
19261927

1927-
/// Attempt to promote the specified stack allocation, returning true if so
1928-
/// or false if not. On success, all uses of the AllocStackInst have been
1929-
/// removed, but the ASI itself is still in the program.
1928+
/// Attempt to promote the specified stack allocation. Its uses may be in a
1929+
/// single block or in multiple blocks.
1930+
///
1931+
/// Note: Populates instructionsToDelete with the instructions the caller is
1932+
/// responsible for deleting.
19301933
bool promoteAllocation(AllocStackInst *asi);
19311934

19321935
public:

0 commit comments

Comments
 (0)