ImplicitNullChecks: Don't add a dead definition of DepMI as live-in

This is one of the fixes needed to reapply D68267 which improves verification
of live-in lists.

Review: craig.topper
https://reviews.llvm.org/D70434
This commit is contained in:
Jonas Paulsson 2019-11-19 13:15:12 +01:00
parent 4cfceb9106
commit f8c0cfc24e
2 changed files with 2 additions and 1 deletions

View File

@ -698,7 +698,7 @@ void ImplicitNullChecks::rewriteNullChecks(
if (auto *DepMI = NC.getOnlyDependency()) {
for (auto &MO : DepMI->operands()) {
if (!MO.isReg() || !MO.getReg() || !MO.isDef())
if (!MO.isReg() || !MO.getReg() || !MO.isDef() || MO.isDead())
continue;
if (!NC.getNotNullSucc()->isLiveIn(MO.getReg()))
NC.getNotNullSucc()->addLiveIn(MO.getReg());

View File

@ -828,6 +828,7 @@ name: inc_store_with_dep
# CHECK-NEXT: $noreg = FAULTING_OP 3, %bb.2, {{[0-9]+}}, $rdi, 1, $noreg, 16, $noreg, $esi
# CHECK-NEXT: JMP_1 %bb.1
# CHECK: bb.1.not_null
# CHECK-NOT: liveins: {{.*}} $eflags
alignment: 16
tracksRegLiveness: true