From afadd2da10b91fa2f781ca93fd5e99b8674671bc Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Fri, 13 Sep 2019 01:34:25 +0000 Subject: [PATCH] Temporarily revert r371640 "LiveIntervals: Split live intervals on multiple dead defs". It reveals a miscompile on Hexagon. See PR43302 for details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371802 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LiveIntervals.cpp | 12 +----------- .../live-intervals-multiple-dead-defs.mir | 18 ------------------ 2 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 test/CodeGen/AMDGPU/live-intervals-multiple-dead-defs.mir diff --git a/lib/CodeGen/LiveIntervals.cpp b/lib/CodeGen/LiveIntervals.cpp index 2d5b8e79910..0781a0b121b 100644 --- a/lib/CodeGen/LiveIntervals.cpp +++ b/lib/CodeGen/LiveIntervals.cpp @@ -196,11 +196,7 @@ void LiveIntervals::computeVirtRegInterval(LiveInterval &LI) { assert(LI.empty() && "Should only compute empty intervals."); LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator()); LRCalc->calculate(LI, MRI->shouldTrackSubRegLiveness(LI.reg)); - - if (computeDeadValues(LI, nullptr)) { - SmallVector SplitIntervals; - splitSeparateComponents(LI, SplitIntervals); - } + computeDeadValues(LI, nullptr); } void LiveIntervals::computeVirtRegs() { @@ -504,8 +500,6 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li, bool LiveIntervals::computeDeadValues(LiveInterval &LI, SmallVectorImpl *dead) { bool MayHaveSplitComponents = false; - bool HaveDeadDef = false; - for (VNInfo *VNI : LI.valnos) { if (VNI->isUnused()) continue; @@ -536,10 +530,6 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI, MachineInstr *MI = getInstructionFromIndex(Def); assert(MI && "No instruction defining live value"); MI->addRegisterDead(LI.reg, TRI); - if (HaveDeadDef) - MayHaveSplitComponents = true; - HaveDeadDef = true; - if (dead && MI->allDefsAreDead()) { LLVM_DEBUG(dbgs() << "All defs dead: " << Def << '\t' << *MI); dead->push_back(MI); diff --git a/test/CodeGen/AMDGPU/live-intervals-multiple-dead-defs.mir b/test/CodeGen/AMDGPU/live-intervals-multiple-dead-defs.mir deleted file mode 100644 index 4c402d7be63..00000000000 --- a/test/CodeGen/AMDGPU/live-intervals-multiple-dead-defs.mir +++ /dev/null @@ -1,18 +0,0 @@ -# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py -# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -verify-machineinstrs -run-pass=machine-scheduler -verify-misched -o - %s | FileCheck %s - -# There are multiple dead defs of the same virtual register. Make sure -# the intervals are split during the initial live range computation. - ---- -name: multiple_connected_components_dead -tracksRegLiveness: true -body: | - bb.0: - ; CHECK-LABEL: name: multiple_connected_components_dead - ; CHECK: dead %1:vgpr_32 = V_MOV_B32_e32 0, implicit $exec - ; CHECK: dead %0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec - dead %0:vgpr_32 = V_MOV_B32_e32 0, implicit $exec - dead %0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec - -... -- 2.50.1