[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegInfo.cpp

Anand Shukla ashukla at cs.uiuc.edu
Sun Jul 20 10:39:27 PDT 2003


Changes in directory llvm/lib/Target/Sparc:

SparcRegInfo.cpp updated: 1.102 -> 1.103

---
Log message:

Added special consideration for instrumentation strategy

---
Diffs of the changes:

Index: llvm/lib/Target/Sparc/SparcRegInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.102 llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.103
--- llvm/lib/Target/Sparc/SparcRegInfo.cpp:1.102	Thu Jul 10 14:42:11 2003
+++ llvm/lib/Target/Sparc/SparcRegInfo.cpp	Sun Jul 20 10:38:14 2003
@@ -1182,6 +1182,15 @@
 
   CallArgsDescriptor* argDesc = CallArgsDescriptor::get(CallMI);
   
+  //if the call is to a instrumentation function, do not
+  //insert save and restore instructions
+  //the instrumentation function takes care of
+  //save restore for volatile regs
+  bool isLLVMFirstTrigger = false;
+  const Function *calledFunction = argDesc->getCallInst()->getCalledFunction();
+  if(calledFunction && calledFunction->getName() == "llvm_first_trigger")
+    isLLVMFirstTrigger = true;
+
   // Now check if the call has a return value (using argDesc) and if so,
   // find the LR of the TmpInstruction representing the return value register.
   // (using the last or second-last *implicit operand* of the call MI).
@@ -1227,6 +1236,11 @@
 	unsigned Color = LR->getColor();
 
 	if ( isRegVolatile(RCID, Color) ) {
+
+	  //if the function is special LLVM function,
+	  //And the register is not modified by call, don't save and restore
+	  if(isLLVMFirstTrigger && !modifiedByCall(RCID, Color))
+	    continue;
 
 	  // if the value is in both LV sets (i.e., live before and after 
 	  // the call machine instruction)





More information about the llvm-commits mailing list