[regalloc] Fix assertion error when LiveInterval is empty
authorwangpc <pc.wang@linux.alibaba.com>
Wed, 26 Jan 2022 06:04:53 +0000 (14:04 +0800)
committerwangpc <pc.wang@linux.alibaba.com>
Wed, 26 Jan 2022 06:06:57 +0000 (14:06 +0800)
commit8597458278027047c06a1a81579893335e761a33
treefb5a479c38a933b8b1798913e217b62882db8897
parentd606e23305015f14072ed59e8e71d6b27d010b48
[regalloc] Fix assertion error when LiveInterval is empty

When evicting interference, it causes an asseertion error
since LiveIntervals::intervalIsInOneMBB assumes that input
is not empty.

This patch fixed bug mentioned in D118020.

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D118124
llvm/lib/CodeGen/LiveIntervals.cpp
llvm/lib/CodeGen/RegAllocGreedy.cpp