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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 05:54:17 PDT 2022


arsenm added inline comments.
Herald added a project: All.


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1169
       if (NeedToAssignLiveThroughs) {
-        DefOperandIndexes.clear();
+        SmallVector<uint16_t, 8> DefOperandIndexes;
         PhysRegUses.clear();
----------------
This now may require new reallocation for each call


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1314
       bool displacedAny = usePhysReg(MI, Reg);
-      if (!displacedAny && !MRI->isReserved(Reg))
+      if (!displacedAny)
         MO.setIsKill(true);
----------------
This part LGTM


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:1367
         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");
 
----------------
This part LGTM


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

https://reviews.llvm.org/D109213



More information about the llvm-commits mailing list