Skip to content

Commit 8cdef92

Browse files
committed
Add a FIXME to CopyPropagation to highlight an incomplete fix.
1 parent 767c569 commit 8cdef92

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/SILOptimizer/Utils/OSSACanonicalizeOwned.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,17 @@ bool OSSACanonicalizeOwned::computeCanonicalLiveness() {
201201

202202
// Conservatively treat a conversion to an unowned value as a pointer
203203
// escape. Is it legal to canonicalize ForwardingUnowned?
204+
//
205+
// FIXME: BitwiseEscape is defined as a leaf use for liveness purposes. It
206+
// implies that any use of those bits that require liveness are already
207+
// handled by something like mark_dependence or fix_lifetime. It should
208+
// be treated as an InstantaneousUse here not a PointerEscape. This was a
209+
// workaround for invalid SIL which may still miscompile in other passes.
210+
// Valid fixes are:
211+
// 1. Compile the stdlib with lexical lifetimes.
212+
// 2. Fix the source to correctly extendLifetime when bit-casting.
213+
// 3. Conservatively change operand ownership for the SIL instruction to
214+
// PointerEscape.
204215
case OperandOwnership::ForwardingUnowned:
205216
case OperandOwnership::PointerEscape:
206217
case OperandOwnership::BitwiseEscape:

0 commit comments

Comments
 (0)