Skip to content

Commit 47fddd4

Browse files
committed
[CodeGen][ShrinkWrap] Clarify StackAddressUsedBlockInfo meaning
1 parent d4ef4b8 commit 47fddd4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

llvm/lib/CodeGen/ShrinkWrap.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ class ShrinkWrap : public MachineFunctionPass {
161161
/// Current MachineFunction.
162162
MachineFunction *MachineFunc = nullptr;
163163

164-
/// Is `true` for block numbers where we can guarantee no stack access
165-
/// or computation of stack-relative addresses on any CFG path including
166-
/// the block itself.
164+
/// Is `true` for the block numbers where we cannot guarantee that there will
165+
/// be no access to the stack or computation of stack-relative addresses on
166+
/// any CFG path including the block itself.
167167
BitVector StackAddressUsedBlockInfo;
168168

169169
/// Check if \p MI uses or defines a callee-saved register or
@@ -948,6 +948,9 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) {
948948

949949
bool Changed = false;
950950

951+
// Initially, conservatively assume that stack addresses can be used in each
952+
// basic block and change the state only for those basic blocks for which we
953+
// were able to prove the opposite.
951954
StackAddressUsedBlockInfo.resize(MF.getNumBlockIDs(), true);
952955
bool HasCandidate = performShrinkWrapping(RPOT, RS.get());
953956
StackAddressUsedBlockInfo.clear();

0 commit comments

Comments
 (0)