File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,10 @@ class ShrinkWrap : public MachineFunctionPass {
161
161
// / Current MachineFunction.
162
162
MachineFunction *MachineFunc = nullptr ;
163
163
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 assume possible stack accesses
165
+ // / or computation of stack-relative addresses on any CFG path including the block itself.
166
+ // / Is `false` for basic blocks where we can guarantee the opposite.
167
+ // / False positives won't lead to incorrect analysis results, therefore this approach is fair.
167
168
BitVector StackAddressUsedBlockInfo;
168
169
169
170
// / Check if \p MI uses or defines a callee-saved register or
@@ -948,6 +949,9 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) {
948
949
949
950
bool Changed = false ;
950
951
952
+ // Initially, conservatively assume that stack addresses can be used in each
953
+ // basic block and change the state only for those basic blocks for which we
954
+ // were able to prove the opposite.
951
955
StackAddressUsedBlockInfo.resize (MF.getNumBlockIDs (), true );
952
956
bool HasCandidate = performShrinkWrapping (RPOT, RS.get ());
953
957
StackAddressUsedBlockInfo.clear ();
You can’t perform that action at this time.
0 commit comments