[PATCH] D109213: [RegAllocFast] Clean-up. Remove redundant operations. NFC.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 21:39:29 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd330731f94c4: [RegAllocFast] Clean-up. Remove redundant operations. NFC. (authored by skatkov).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109213/new/

https://reviews.llvm.org/D109213

Files:
  llvm/lib/CodeGen/RegAllocFast.cpp


Index: llvm/lib/CodeGen/RegAllocFast.cpp
===================================================================
--- llvm/lib/CodeGen/RegAllocFast.cpp
+++ llvm/lib/CodeGen/RegAllocFast.cpp
@@ -1354,7 +1354,7 @@
       if (MRI->isReserved(Reg))
         continue;
       bool displacedAny = usePhysReg(MI, Reg);
-      if (!displacedAny && !MRI->isReserved(Reg))
+      if (!displacedAny)
         MO.setIsKill(true);
     }
   }
@@ -1406,12 +1406,7 @@
     for (MachineOperand &MO : llvm::reverse(MI.operands())) {
       if (!MO.isReg() || !MO.isDef() || !MO.isEarlyClobber())
         continue;
-      // subreg defs don't free the full register. We left the subreg number
-      // around as a marker in setPhysReg() to recognize this case here.
-      if (MO.getSubReg() != 0) {
-        MO.setSubReg(0);
-        continue;
-      }
+      assert(!MO.getSubReg() && "should be already handled in def processing");
 
       Register Reg = MO.getReg();
       if (!Reg)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109213.465275.patch
Type: text/x-patch
Size: 968 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221005/161dde41/attachment.bin>


More information about the llvm-commits mailing list