File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 83
83
// / | Use | [LiveWithin]
84
84
// / -----
85
85
// /
86
+ // / ---------------------------------------------------------------------------
87
+ // /
88
+ // / "Use points" are the instructions that "generate" liveness for a given
89
+ // / operand. A generalized use point visitor would look like this:
90
+ // /
91
+ // / Given an \p operand, visit the use points relevant for liveness. For most
92
+ // / operands, this is simply the user instruction. For scoped operands, each
93
+ // / scope-ending instruction is a separate use point.
94
+ // / template<typename Operation>
95
+ // / inline bool visitUsePoints(Operand *use, Operation visitUsePoint) {
96
+ // / // Handle TrivialUse operands: begin_access & store_borrow address
97
+ // / // Handle InteriorPointer operands: store_borrow source
98
+ // / if (auto scopedAddress = ScopedAddressValue::forUse(use)) {
99
+ // / return scopedAddress.visitScopeEndingUses(visitUsePoint);
100
+ // / }
101
+ // / // Handle Borrow operands...
102
+ // / // Handles borrow scope introducers: begin_borrow & load_borrow.
103
+ // / // Handles guaranteed return values: begin_apply.
104
+ // / if (!BorrowingOperand(operand).visitScopeEndingUses([this](Operand *end) {
105
+ // / if (!visitUsePoint(end))
106
+ // / return false;
107
+ // / return true;
108
+ // / }
109
+ // / return visitUsePoint(use);
110
+ // / }
111
+ // /
112
+ // / The visitors that switch on OperandOwnership use a specialized
113
+ // / implementation because each case above is specific to an ownership case.
86
114
// ===----------------------------------------------------------------------===//
87
115
88
116
#ifndef SWIFT_SILOPTIMIZER_UTILS_PRUNEDLIVENESS_H
You can’t perform that action at this time.
0 commit comments