diff options
Diffstat (limited to 'gnu/llvm/lib/CodeGen/SafeStackColoring.cpp')
| -rw-r--r-- | gnu/llvm/lib/CodeGen/SafeStackColoring.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp b/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp index 329458778a9..726c3800281 100644 --- a/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp +++ b/gnu/llvm/lib/CodeGen/SafeStackColoring.cpp @@ -46,11 +46,10 @@ const StackColoring::LiveRange &StackColoring::getLiveRange(AllocaInst *AI) { } bool StackColoring::readMarker(Instruction *I, bool *IsStart) { - auto *II = dyn_cast<IntrinsicInst>(I); - if (!II || (II->getIntrinsicID() != Intrinsic::lifetime_start && - II->getIntrinsicID() != Intrinsic::lifetime_end)) + if (!I->isLifetimeStartOrEnd()) return false; + auto *II = cast<IntrinsicInst>(I); *IsStart = II->getIntrinsicID() == Intrinsic::lifetime_start; return true; } @@ -172,7 +171,9 @@ void StackColoring::calculateLocalLiveness() { BitVector LocalLiveIn; for (auto *PredBB : predecessors(BB)) { LivenessMap::const_iterator I = BlockLiveness.find(PredBB); - assert(I != BlockLiveness.end() && "Predecessor not found"); + // If a predecessor is unreachable, ignore it. + if (I == BlockLiveness.end()) + continue; LocalLiveIn |= I->second.LiveOut; } |
