[llvm-commits] CVS: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Sun May 30 03:48:01 PDT 2004


Changes in directory reopt/lib/LightWtProfiling:

UnpackTraceFunction.cpp updated: 1.74 -> 1.75

---
Log message:

Remove insertCopyMachineInstrs(), which is no longer called.

Something like it will be needed in the future, but this is just not
quite how it will need to be implemented, and in the meantime, we go
for simplicity.


---
Diffs of the changes:  (+0 -52)

Index: reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp
diff -u reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.74 reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.75
--- reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp:1.74	Sun May 30 03:43:11 2004
+++ reopt/lib/LightWtProfiling/UnpackTraceFunction.cpp	Sun May 30 03:47:11 2004
@@ -64,56 +64,6 @@
   return staticStackSize;
 }
 
-/// Insert the appropriate machine instruction(s) that copies the value in
-/// Source to the location specified by Target, at the beginning of B.
-///
-void UnpackTraceFunction::insertCopyMachineInstrs (AllocInfo &Source,
-                                                   AllocInfo &Target,
-                                                   MachineBasicBlock &B,
-                                                   const Type *Ty) {
-  const TargetRegInfo &TRI = TM->getRegInfo ();
-  std::vector<MachineInstr *> mvec;
-  int RegType;
-  // Guess what kind of reg the register was allocated to.
-  if (Ty == Type::FloatTy)
-    RegType = SparcV9RegInfo::FPSingleRegType;
-  else if (Ty == Type::DoubleTy)
-    RegType = SparcV9RegInfo::FPDoubleRegType;
-  else
-    RegType = SparcV9RegInfo::IntRegType;
-  const unsigned FramePtrReg = TRI.getFramePointer ();
-  const unsigned StackPtrReg = TRI.getStackPointer ();
-  if (Source.AllocState == AllocInfo::Spilled
-      && Target.AllocState == AllocInfo::Allocated) {
-    // Emit load instruction from stack loc. Source into register Target
-    TRI.cpMem2RegMI (mvec, FramePtrReg, Source.Placement, Target.Placement,
-                     RegType);
-  } else if (Source.AllocState == AllocInfo::Allocated
-             && Target.AllocState == AllocInfo::Allocated) {
-    // Emit move instruction from register Source to register Target
-    TRI.cpReg2RegMI (mvec, Source.Placement, Target.Placement, RegType);
-  } else if (Source.AllocState == AllocInfo::Allocated
-             && Target.AllocState == AllocInfo::Spilled) {
-    // Emit store instruction from register Source to stack loc. Target
-    TRI.cpReg2MemMI (mvec, Source.Placement, FramePtrReg, Target.Placement,
-                     RegType);
-  } else if (Source.AllocState == AllocInfo::Spilled
-             && Target.AllocState == AllocInfo::Spilled) {
-    const unsigned TempReg = 
-      TRI.getUnifiedRegNum (SparcV9RegInfo::IntRegClassID,
-                            SparcV9IntRegClass::g1); // just pick one?
-    // Emit load instruction from stack loc. Source into register TempReg
-    TRI.cpMem2RegMI (mvec, FramePtrReg, Source.Placement, TempReg, RegType);
-    // Emit store instruction from register TempReg to stack loc. Target
-    TRI.cpReg2MemMI (mvec, TempReg, FramePtrReg, Target.Placement, RegType);
-  }
-  // Add whatever the TargetRegInfo gave us to the MachineBasicBlock we are
-  // working on.
-  for (std::vector<MachineInstr *>::iterator i = mvec.begin (),
-         e = mvec.end (); i != e; ++i)
-    B.push_back (*i);
-}
-
 /// Returns a pointer to the return instruction in B, if B contains
 /// one, or null otherwise.
 ///
@@ -264,8 +214,6 @@
     AllocInfo &Source = ai.first, &Target = ai.second;
     assert (Target.AllocState == AllocInfo::Allocated
             && "FIXME: can't do mem-->mem copy of live-ins yet");
-    // FIXME: The following should really be using insertCopyMachineInstrs or
-    // something like it.
     mvec.clear ();
     assert (TRI.getRegType (Target.Placement)
             == TRI.getRegType (Source.Placement)





More information about the llvm-commits mailing list