@@ -71,9 +71,10 @@ struct OwnershipFixupContext {
71
71
// / and use this to seed that new lifetime.
72
72
SmallVector<Operand *, 8 > allAddressUsesFromOldValue;
73
73
74
- // / This is the interior pointer operand that the new value we want to RAUW
75
- // / is transitively derived from and enables us to know the underlying
76
- // / borrowed base value that we need to lifetime extend.
74
+ // / This is the interior pointer (e.g. ref_element_addr)
75
+ // / that the new value we want to RAUW is transitively derived from and
76
+ // / enables us to know the underlying borrowed base value that we need to
77
+ // / lifetime extend.
77
78
// /
78
79
// / This is only initialized when the interior pointer has uses that must be
79
80
// / replaced.
@@ -149,9 +150,15 @@ class OwnershipRAUWHelper {
149
150
operator bool () const { return isValid (); }
150
151
bool isValid () const { return bool (ctx) && bool (oldValue) && bool (newValue); }
151
152
152
- // / Perform the actual RAUW. We require that \p newValue and \p oldValue have
153
- // / the same type at this point (in contrast to when calling
154
- // / OwnershipRAUWFixupHelper::get()).
153
+ // / True if replacement requires copying the original instruction's source
154
+ // / operand, creating a new borrow scope for that copy, then cloning the
155
+ // / original.
156
+ bool requiresCopyBorrowAndClone () const {
157
+ return ctx->extraAddressFixupInfo .base ;
158
+ }
159
+
160
+ // / Perform OSSA fixup on newValue and return a fixed-up value based that can
161
+ // / be used to replace all uses of oldValue.
155
162
// /
156
163
// / This is so that we can avoid creating "forwarding" transformation
157
164
// / instructions before we know if we can perform the RAUW. Any such
0 commit comments