diff --git a/lib/SILPasses/SILCodeMotion.cpp b/lib/SILPasses/SILCodeMotion.cpp index 8cd69b42b28..31aad98bdcf 100644 --- a/lib/SILPasses/SILCodeMotion.cpp +++ b/lib/SILPasses/SILCodeMotion.cpp @@ -95,6 +95,10 @@ void promoteMemoryOperationsInBlock(SILBasicBlock *BB) { if (isReadNone(BI)) continue; + // cond_fail does not read/write memory in a manner that we care about. + if (isa(Inst)) + continue; + // All other instructions that read from memory invalidate the store. if (Inst->mayReadFromMemory()) PrevStore = 0;