[llvm] 2ec5fc0 - DAG: Remove redundant handling of reg fixups

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 15:33:00 PDT 2020


Author: Matt Arsenault
Date: 2020-07-08T18:32:43-04:00
New Revision: 2ec5fc0c61fb4472bd5f9ea71130cdba215ed9a8

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

LOG: DAG: Remove redundant handling of reg fixups

It looks like 9cac4e6d1403554b06ec2fc9d834087b1234b695 accidentally
added a second copy of this from a bad rebase or something. This
second copy was added, and the finalizeLowering call was not deleted
as intended.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 51afccdcb645..df0ce502a059 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -661,34 +661,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
   // Determine if floating point is used for msvc
   computeUsesMSVCFloatingPoint(TM.getTargetTriple(), Fn, MF->getMMI());
 
-  // Replace forward-declared registers with the registers containing
-  // the desired value.
-  for (DenseMap<Register, Register>::iterator
-       I = FuncInfo->RegFixups.begin(), E = FuncInfo->RegFixups.end();
-       I != E; ++I) {
-    Register From = I->first;
-    Register To = I->second;
-    // If To is also scheduled to be replaced, find what its ultimate
-    // replacement is.
-    while (true) {
-      DenseMap<Register, Register>::iterator J = FuncInfo->RegFixups.find(To);
-      if (J == E) break;
-      To = J->second;
-    }
-    // Make sure the new register has a sufficiently constrained register class.
-    if (Register::isVirtualRegister(From) && Register::isVirtualRegister(To))
-      MRI.constrainRegClass(To, MRI.getRegClass(From));
-    // Replace it.
-
-
-    // Replacing one register with another won't touch the kill flags.
-    // We need to conservatively clear the kill flags as a kill on the old
-    // register might dominate existing uses of the new register.
-    if (!MRI.use_empty(To))
-      MRI.clearKillFlags(From);
-    MRI.replaceRegWith(From, To);
-  }
-
   TLI->finalizeLowering(*MF);
 
   // Release function-specific state. SDB and CurDAG are already cleared


        


More information about the llvm-commits mailing list