mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
LICM: don't let cond_fail prevent hoisting initializations of global variables
And fix the corresponding test file
This commit is contained in:
@@ -231,6 +231,8 @@ static bool mayConflictWithGlobalInit(AliasAnalysis *AA,
|
||||
if (auto *LI = dyn_cast<LoadInst>(sideEffectInst)) {
|
||||
return AA->mayWriteToMemory(globalInitCall, LI->getOperand());
|
||||
}
|
||||
if (isa<CondFailInst>(sideEffectInst))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user