mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ABCOpts: Bail out if we don't know how-to hoist an array operation
Instead of assuming we see only certain forms IR. rdar://28204253
This commit is contained in:
@@ -1010,6 +1010,10 @@ static bool hoistChecksInLoop(DominanceInfo *DT, DominanceInfoNode *DTNode,
|
||||
if (!ArrayIndex)
|
||||
continue;
|
||||
|
||||
// Make sure we know how-to hoist the array call.
|
||||
if (!ArrayCall.canHoist(Preheader->getTerminator(), DT))
|
||||
continue;
|
||||
|
||||
// Invariant check.
|
||||
if (blockAlwaysExecutes && dominates(DT, ArrayIndex, Preheader)) {
|
||||
assert(ArrayCall.canHoist(Preheader->getTerminator(), DT) &&
|
||||
|
||||
Reference in New Issue
Block a user