From 91014f6b0cec1c517d6da14787d9f2985ab40277 Mon Sep 17 00:00:00 2001 From: Ruchira Sasanka Date: Mon, 12 Nov 2001 20:31:47 +0000 Subject: [PATCH] Canged ColorCallArg so that when a call arg is directly pushed on to stack for argument passing, that instruction is directly added to the InstructionsBefore set of the called machine instruction - i.e., it is not reordered. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1277 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9RegInfo.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9RegInfo.cpp b/lib/Target/SparcV9/SparcV9RegInfo.cpp index 4040b02579d..b576d05e6fa 100644 --- a/lib/Target/SparcV9/SparcV9RegInfo.cpp +++ b/lib/Target/SparcV9/SparcV9RegInfo.cpp @@ -668,7 +668,11 @@ void UltraSparcRegInfo::colorCallArgs(const MachineInstr *const CallMI, AdMI = cpReg2MemMI(UniLRReg, getStackPointer(), argOffset, RegType ); } - AddedInstrnsBefore.push_back( AdMI ); // Now add the instruction + // Now add the instruction. We can directly add to + // CallAI->InstrnsBefore since we are just saving a reg on stack + // + CallAI->InstrnsBefore.push_back( AdMI ); + //cerr << "\nCaution: Passing a reg on stack"; } else { // LR is not colored (i.e., spilled) @@ -683,6 +687,7 @@ void UltraSparcRegInfo::colorCallArgs(const MachineInstr *const CallMI, AdMI = cpMem2RegMI(getFramePointer(), LR->getSpillOffFromFP(), UniArgReg, RegType ); + cerr << "\nCaution: Loading a spilled val to a reg as a call arg"; AddedInstrnsBefore.push_back( AdMI ); // Now add the instruction } @@ -728,7 +733,7 @@ void UltraSparcRegInfo::colorCallArgs(const MachineInstr *const CallMI, CallAI->InstrnsBefore.push_back( Ad3 ); CallAI->InstrnsBefore.push_back( Ad4 ); - cerr << "\n Caution: Call arg moved from stack to stack"; + cerr << "\nCaution: Call arg moved from stack2stack for: " << *CallMI ; } } -- 2.34.1