[llvm] d330731 - [RegAllocFast] Clean-up. Remove redundant operations. NFC.

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


Author: Serguei Katkov
Date: 2022-10-05T11:38:54+07:00
New Revision: d330731f94c4ffedc2250933f7d467bf658603d6

URL: https://github.com/llvm/llvm-project/commit/d330731f94c4ffedc2250933f7d467bf658603d6
DIFF: https://github.com/llvm/llvm-project/commit/d330731f94c4ffedc2250933f7d467bf658603d6.diff

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

Reviewed By: MatzeB, arsenm
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D109213

Added: 
    

Modified: 
    llvm/lib/CodeGen/RegAllocFast.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/RegAllocFast.cpp b/llvm/lib/CodeGen/RegAllocFast.cpp
index 1f9f8056fdae..c3e68f8a1c6b 100644
--- a/llvm/lib/CodeGen/RegAllocFast.cpp
+++ b/llvm/lib/CodeGen/RegAllocFast.cpp
@@ -1354,7 +1354,7 @@ void RegAllocFast::allocateInstruction(MachineInstr &MI) {
       if (MRI->isReserved(Reg))
         continue;
       bool displacedAny = usePhysReg(MI, Reg);
-      if (!displacedAny && !MRI->isReserved(Reg))
+      if (!displacedAny)
         MO.setIsKill(true);
     }
   }
@@ -1406,12 +1406,7 @@ void RegAllocFast::allocateInstruction(MachineInstr &MI) {
     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)


        


More information about the llvm-commits mailing list