Add map info for arguments to call (copies)
authorAnand Shukla <ashukla@cs.uiuc.edu>
Sun, 1 Jun 2003 02:48:23 +0000 (02:48 +0000)
committerAnand Shukla <ashukla@cs.uiuc.edu>
Sun, 1 Jun 2003 02:48:23 +0000 (02:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6503 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9RegInfo.cpp

index 141f22667d69c94934e47265d4883836e74f22ce..1cc274de00f76619adf53c8ff1d22bb6b82f7c68 100644 (file)
@@ -12,6 +12,7 @@
 #include "llvm/CodeGen/PhyRegAlloc.h"
 #include "llvm/CodeGen/InstrSelection.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineCodeForInstruction.h"
 #include "llvm/CodeGen/MachineInstrAnnot.h"
 #include "llvm/CodeGen/FunctionLiveVarInfo.h"   // FIXME: Remove
 #include "../../CodeGen/RegAlloc/RegAllocCommon.h"   // FIXME!
@@ -940,10 +941,19 @@ void UltraSparcRegInfo::colorCallArgs(MachineInstr *CallMI,
   // 
   for(unsigned i=0; i < ReorderedVec.size(); i++)
     CallAI->InstrnsBefore.push_back( ReorderedVec[i] );
+
+  //Insert machine instructions before and after call into the
+  //call instructions map --- Anand
+  const CallInst *callInst = argDesc->getCallInst();
+  MachineCodeForInstruction &mvec = MachineCodeForInstruction::get(callInst);
+  mvec.insert(mvec.begin(), CallAI->InstrnsBefore.begin(), 
+             CallAI->InstrnsBefore.end());
+  mvec.insert(mvec.end(), CallAI->InstrnsAfter.begin(), 
+             CallAI->InstrnsAfter.end());
 }
 
 //---------------------------------------------------------------------------
-// This method is called for an LLVM return instruction to identify which
+// this method is called for an LLVM return instruction to identify which
 // values will be returned from this method and to suggest colors.
 //---------------------------------------------------------------------------
 void UltraSparcRegInfo::suggestReg4RetValue(MachineInstr *RetMI,