aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/SparcV9/SparcV9RegInfo.cpp
diff options
context:
space:
mode:
authorAnand Shukla <ashukla@cs.uiuc.edu>2003-07-20 15:39:30 +0000
committerAnand Shukla <ashukla@cs.uiuc.edu>2003-07-20 15:39:30 +0000
commit6da69e75ec594afe6758d923ff011b59c2e82dee (patch)
tree9b25ebf7c0a3497dba6ff737090c735367f7c808 /lib/Target/SparcV9/SparcV9RegInfo.cpp
parentfcf2be75ec61c6ae3da53d0e4e9f53b4d754dc9b (diff)
downloadexternal_llvm-6da69e75ec594afe6758d923ff011b59c2e82dee.zip
external_llvm-6da69e75ec594afe6758d923ff011b59c2e82dee.tar.gz
external_llvm-6da69e75ec594afe6758d923ff011b59c2e82dee.tar.bz2
Added special consideration for instrumentation strategy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7208 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/SparcV9RegInfo.cpp')
-rw-r--r--lib/Target/SparcV9/SparcV9RegInfo.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp
index e1eb148..42b9d10 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.cpp
+++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp
@@ -1182,6 +1182,15 @@ UltraSparcRegInfo::insertCallerSavingCode
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).
@@ -1228,6 +1237,11 @@ UltraSparcRegInfo::insertCallerSavingCode
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)