mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Optimizer: fix an ownership violation when duplicating loops
If a guaranteed value is used in a dead-end exit block and the enclosing value is _not_ destroyed in this block, we end up missing the enclosing value as phi-argument after duplicating the loop. TODO: once we have complete lifetimes we can remove this check again. rdar://159125605
This commit is contained in:
@@ -28,6 +28,7 @@ class SILInstruction;
|
||||
class SILLoop;
|
||||
class DominanceInfo;
|
||||
class SILLoopInfo;
|
||||
class DeadEndBlocks;
|
||||
|
||||
/// Canonicalize the loop for rotation and downstream passes.
|
||||
///
|
||||
@@ -40,7 +41,7 @@ bool canonicalizeAllLoops(DominanceInfo *DT, SILLoopInfo *LI);
|
||||
|
||||
/// Check whether it is safe to duplicate this instruction when duplicating
|
||||
/// this loop by unrolling or versioning.
|
||||
bool canDuplicateLoopInstruction(SILLoop *L, SILInstruction *Inst);
|
||||
bool canDuplicateLoopInstruction(SILLoop *L, SILInstruction *Inst, DeadEndBlocks *deb);
|
||||
|
||||
/// A visitor that visits loops in a function in a bottom up order. It only
|
||||
/// performs the visit.
|
||||
|
||||
Reference in New Issue
Block a user