[llvm] r267976 - RegisterPressure: Cannot produce dead (subregister) defs anymore

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 19:44:48 PDT 2016


Author: matze
Date: Thu Apr 28 21:44:48 2016
New Revision: 267976

URL: http://llvm.org/viewvc/llvm-project?rev=267976&view=rev
Log:
RegisterPressure: Cannot produce dead (subregister) defs anymore

With the DetectDeadLanes pass in place we cannot run into situations
anymore where defs suddenly become dead.
Also add a missing check so we do not try to add an undef flag to a
physreg (found by visual inspection, no failing test).

Modified:
    llvm/trunk/lib/CodeGen/RegisterPressure.cpp

Modified: llvm/trunk/lib/CodeGen/RegisterPressure.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterPressure.cpp?rev=267976&r1=267975&r2=267976&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterPressure.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterPressure.cpp Thu Apr 28 21:44:48 2016
@@ -573,9 +573,6 @@ void RegisterOperands::adjustLaneLivenes
     LaneBitmask LaneMask = I->LaneMask & LiveAfter;
     if (LaneMask == 0) {
       I = Defs.erase(I);
-      // Make sure the operand is properly marked as Dead.
-      if (AddFlagsMI != nullptr)
-        AddFlagsMI->addRegisterDead(RegUnit, MRI.getTargetRegisterInfo());
     } else {
       I->LaneMask = LaneMask;
       ++I;
@@ -595,6 +592,8 @@ void RegisterOperands::adjustLaneLivenes
   if (AddFlagsMI != nullptr) {
     for (const RegisterMaskPair &P : DeadDefs) {
       unsigned RegUnit = P.RegUnit;
+      if (!TargetRegisterInfo::isVirtualRegister(RegUnit))
+        continue;
       LaneBitmask LiveAfter = getLiveLanesAt(LIS, MRI, true, RegUnit,
                                              Pos.getDeadSlot());
       if (LiveAfter == 0)




More information about the llvm-commits mailing list