[llvm-branch-commits] [llvm-branch] r103978 - in /llvm/branches/Apple/Morbo: ./ include/llvm/CodeGen/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/Blackfin/ lib/Target/CellSPU/ lib/Target/MBlaze/ lib/Target/MBlaze/AsmPrinter/ lib/Target/Mips/ lib/Target/Mips/AsmPrinter/ lib/Target/PowerPC/ lib/Target/X86/ test/CodeGen/SystemZ/
Bill Wendling
isanbard at gmail.com
Mon May 17 14:19:00 PDT 2010
Author: void
Date: Mon May 17 16:19:00 2010
New Revision: 103978
URL: http://llvm.org/viewvc/llvm-project?rev=103978&view=rev
Log:
$ svn merge -c 103802 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r103802 into '.':
U include/llvm/CodeGen/MachineFrameInfo.h
U lib/CodeGen/AsmPrinter/DwarfException.cpp
U lib/CodeGen/AsmPrinter/DwarfException.h
U lib/CodeGen/PrologEpilogInserter.cpp
U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
U lib/Target/X86/X86RegisterInfo.cpp
U lib/Target/X86/X86ISelLowering.cpp
U lib/Target/CellSPU/SPURegisterInfo.cpp
U lib/Target/MBlaze/MBlazeRegisterInfo.cpp
U lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp
U lib/Target/SystemZ/SystemZRegisterInfo.cpp
U lib/Target/PowerPC/PPCRegisterInfo.cpp
U lib/Target/ARM/ARMBaseRegisterInfo.cpp
U lib/Target/TargetMachine.cpp
U lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U lib/Target/Mips/MipsRegisterInfo.cpp
U lib/Target/Blackfin/BlackfinRegisterInfo.cpp
$ svn merge -c 103804 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r103804 into '.':
G lib/Target/X86/X86RegisterInfo.cpp
$ svn merge -c 103808 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r103808 into '.':
G lib/Target/X86/X86RegisterInfo.cpp
G lib/Target/TargetMachine.cpp
$ svn merge -c 103813 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r103813 into '.':
G lib/Target/X86/X86RegisterInfo.cpp
$ svn merge -c 103824 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r103824 into '.':
U lib/Target/X86/X86RegisterInfo.cpp
$ svn merge -c 103829 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r103829 into '.':
U test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll
G lib/Target/SystemZ/SystemZRegisterInfo.cpp
Modified:
llvm/branches/Apple/Morbo/ (props changed)
llvm/branches/Apple/Morbo/include/llvm/CodeGen/MachineFrameInfo.h
llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.h
llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/branches/Apple/Morbo/lib/Target/ARM/ARMBaseRegisterInfo.cpp
llvm/branches/Apple/Morbo/lib/Target/Blackfin/BlackfinRegisterInfo.cpp
llvm/branches/Apple/Morbo/lib/Target/CellSPU/SPURegisterInfo.cpp
llvm/branches/Apple/Morbo/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp
llvm/branches/Apple/Morbo/lib/Target/MBlaze/MBlazeRegisterInfo.cpp
llvm/branches/Apple/Morbo/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
llvm/branches/Apple/Morbo/lib/Target/Mips/MipsRegisterInfo.cpp
llvm/branches/Apple/Morbo/lib/Target/PowerPC/PPCRegisterInfo.cpp
llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp
llvm/branches/Apple/Morbo/lib/Target/X86/X86RegisterInfo.cpp
llvm/branches/Apple/Morbo/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll
Propchange: llvm/branches/Apple/Morbo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 17 16:19:00 2010
@@ -1,2 +1,2 @@
/llvm/branches/Apple/Hermes:96832,96835,96858,96870,96876,96879
-/llvm/trunk:98602,98604,98612,98615-98616,98675,98686,98743-98744,98768,98773,98778,98780,98810,98835,98839,98845,98855,98862,98881,98920,98977,99032-99033,99043,99196,99223,99263,99282-99284,99306,99319-99321,99324,99336,99378,99418,99423,99429,99440,99455,99463,99465,99469,99484,99490,99492-99494,99507,99524,99537,99539-99540,99544,99570,99575,99598,99620,99629-99630,99636,99671,99692,99695,99697,99699,99722,99816,99835-99836,99845-99846,99848,99850,99855,99879,99881-99883,99895,99899,99910,99916,99919,99952-99954,99957,99959,99974-99975,99982,99984-99986,99988-99989,99992-99993,99995,99997-99999,100016,100035,100037-100038,100042,100044,100056,100072,100074,100078,100081-100090,100092,100094-100095,100116,100134,100184,100209,100214-100218,100220-100221,100223-100225,100231,100250,100252,100257,100261,100304,100332,100353,100384,100454-100455,100457,100466,100478,100480,100487,100494,100497,100505,100521,100553,100568,100584,100592,100609-100610,100636,100710,100736,10074
2,100751,100768-100769,100771,100781,100797,100804,100837,100867,100892,100936-100937,101011,101023,101075,101077,101079,101081,101085,101154,101158,101162,101165,101181,101190,101202,101282,101294,101303,101314-101315,101317,101331,101343,101383,101392,101420,101453,101604,101615,101629,101684-101686,101805,101845,101847,101851,101855,101870,101879,101897,101925,101930,101965,102120,102225,102358,102394,102396,102405,102421,102454,102463,102468,102470,102481,102486,102504-102505,102508-102510,102513,102519,102524,102526,102531,102558,102646,102653,102655,102661-102662,102672,102743,102760,102770,102791,102948,102970,102980,103001,103133,103233,103314,103356,103415,103439,103451,103455,103459
+/llvm/trunk:98602,98604,98612,98615-98616,98675,98686,98743-98744,98768,98773,98778,98780,98810,98835,98839,98845,98855,98862,98881,98920,98977,99032-99033,99043,99196,99223,99263,99282-99284,99306,99319-99321,99324,99336,99378,99418,99423,99429,99440,99455,99463,99465,99469,99484,99490,99492-99494,99507,99524,99537,99539-99540,99544,99570,99575,99598,99620,99629-99630,99636,99671,99692,99695,99697,99699,99722,99816,99835-99836,99845-99846,99848,99850,99855,99879,99881-99883,99895,99899,99910,99916,99919,99952-99954,99957,99959,99974-99975,99982,99984-99986,99988-99989,99992-99993,99995,99997-99999,100016,100035,100037-100038,100042,100044,100056,100072,100074,100078,100081-100090,100092,100094-100095,100116,100134,100184,100209,100214-100218,100220-100221,100223-100225,100231,100250,100252,100257,100261,100304,100332,100353,100384,100454-100455,100457,100466,100478,100480,100487,100494,100497,100505,100521,100553,100568,100584,100592,100609-100610,100636,100710,100736,10074
2,100751,100768-100769,100771,100781,100797,100804,100837,100867,100892,100936-100937,101011,101023,101075,101077,101079,101081,101085,101154,101158,101162,101165,101181,101190,101202,101282,101294,101303,101314-101315,101317,101331,101343,101383,101392,101420,101453,101604,101615,101629,101684-101686,101805,101845,101847,101851,101855,101870,101879,101897,101925,101930,101965,101971,101979,102111,102120,102192,102202,102225,102236-102237,102358,102366,102394,102396,102405,102421,102454-102456,102463,102467-102468,102470,102481,102486-102488,102492-102493,102504-102505,102508-102510,102513,102519,102524,102526,102531,102558,102646,102653,102655,102661-102662,102672,102743,102760,102770,102791,102948,102970,102980,103001,103133,103233,103314,103356,103415,103419,103439,103451,103455,103459,103802,103804,103808,103813,103824,103829
Modified: llvm/branches/Apple/Morbo/include/llvm/CodeGen/MachineFrameInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/include/llvm/CodeGen/MachineFrameInfo.h?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/include/llvm/CodeGen/MachineFrameInfo.h (original)
+++ llvm/branches/Apple/Morbo/include/llvm/CodeGen/MachineFrameInfo.h Mon May 17 16:19:00 2010
@@ -160,8 +160,12 @@
///
unsigned MaxAlignment;
- /// HasCalls - Set to true if this function has any function calls. This is
- /// only valid during and after prolog/epilog code insertion.
+ /// AdjustsStack - Set to true if this function adjusts the stack -- e.g.,
+ /// when calling another function. This is only valid during and after
+ /// prolog/epilog code insertion.
+ bool AdjustsStack;
+
+ /// HasCalls - Set to true if this function has any function calls.
bool HasCalls;
/// StackProtectorIdx - The frame index for the stack protector.
@@ -204,6 +208,7 @@
StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
HasVarSizedObjects = false;
FrameAddressTaken = false;
+ AdjustsStack = false;
HasCalls = false;
StackProtectorIdx = -1;
MaxCallFrameSize = 0;
@@ -329,9 +334,13 @@
///
void setMaxAlignment(unsigned Align) { MaxAlignment = Align; }
- /// hasCalls - Return true if the current function has no function calls.
- /// This is only valid during or after prolog/epilog code emission.
- ///
+ /// AdjustsStack - Return true if this function adjusts the stack -- e.g.,
+ /// when calling another function. This is only valid during and after
+ /// prolog/epilog code insertion.
+ bool adjustsStack() const { return AdjustsStack; }
+ void setAdjustsStack(bool V) { AdjustsStack = V; }
+
+ /// hasCalls - Return true if the current function has any function calls.
bool hasCalls() const { return HasCalls; }
void setHasCalls(bool V) { HasCalls = V; }
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.cpp Mon May 17 16:19:00 2010
@@ -192,7 +192,7 @@
// EH Frame, but some environments do not handle weak absolute symbols. If
// UnwindTablesMandatory is set we cannot do this optimization; the unwind
// info is to be available for non-EH uses.
- if (!EHFrameInfo.hasCalls && !UnwindTablesMandatory &&
+ if (!EHFrameInfo.adjustsStack && !UnwindTablesMandatory &&
(!TheFunc->isWeakForLinker() ||
!MAI->getWeakDefDirective() ||
TLOF.getSupportsWeakOmittedEHFrame())) {
@@ -958,7 +958,7 @@
// Save EH frame information
EHFrames.push_back(FunctionEHFrameInfo(FunctionEHSym, SubprogramCount,
MMI->getPersonalityIndex(),
- MF->getFrameInfo()->hasCalls(),
+ MF->getFrameInfo()->adjustsStack(),
!MMI->getLandingPads().empty(),
MMI->getFrameMoves(),
MF->getFunction()));
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.h?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.h (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/DwarfException.h Mon May 17 16:19:00 2010
@@ -37,7 +37,7 @@
MCSymbol *FunctionEHSym; // L_foo.eh
unsigned Number;
unsigned PersonalityIndex;
- bool hasCalls;
+ bool adjustsStack;
bool hasLandingPads;
std::vector<MachineMove> Moves;
const Function *function;
@@ -47,7 +47,7 @@
const std::vector<MachineMove> &M,
const Function *f):
FunctionEHSym(EHSym), Number(Num), PersonalityIndex(P),
- hasCalls(hC), hasLandingPads(hL), Moves(M), function (f) { }
+ adjustsStack(hC), hasLandingPads(hL), Moves(M), function (f) { }
};
std::vector<FunctionEHFrameInfo> EHFrames;
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp Mon May 17 16:19:00 2010
@@ -97,8 +97,8 @@
// Add prolog and epilog code to the function. This function is required
// to align the stack frame as necessary for any stack variables or
- // called functions. Because of this, calculateCalleeSavedRegisters
- // must be called before this function in order to set the HasCalls
+ // called functions. Because of this, calculateCalleeSavedRegisters()
+ // must be called before this function in order to set the AdjustsStack
// and MaxCallFrameSize variables.
if (!F->hasFnAttr(Attribute::Naked))
insertPrologEpilogCode(Fn);
@@ -132,7 +132,7 @@
}
#endif
-/// calculateCallsInformation - Calculate the MaxCallFrameSize and HasCalls
+/// calculateCallsInformation - Calculate the MaxCallFrameSize and AdjustsStack
/// variables for the function's frame information and eliminate call frame
/// pseudo instructions.
void PEI::calculateCallsInformation(MachineFunction &Fn) {
@@ -140,7 +140,7 @@
MachineFrameInfo *FFI = Fn.getFrameInfo();
unsigned MaxCallFrameSize = 0;
- bool HasCalls = FFI->hasCalls();
+ bool AdjustsStack = FFI->adjustsStack();
// Get the function call frame set-up and tear-down instruction opcode
int FrameSetupOpcode = RegInfo->getCallFrameSetupOpcode();
@@ -160,15 +160,15 @@
" instructions should have a single immediate argument!");
unsigned Size = I->getOperand(0).getImm();
if (Size > MaxCallFrameSize) MaxCallFrameSize = Size;
- HasCalls = true;
+ AdjustsStack = true;
FrameSDOps.push_back(I);
} else if (I->isInlineAsm()) {
// An InlineAsm might be a call; assume it is to get the stack frame
// aligned correctly for calls.
- HasCalls = true;
+ AdjustsStack = true;
}
- FFI->setHasCalls(HasCalls);
+ FFI->setAdjustsStack(AdjustsStack);
FFI->setMaxCallFrameSize(MaxCallFrameSize);
for (std::vector<MachineBasicBlock::iterator>::iterator
@@ -582,7 +582,7 @@
// If we have reserved argument space for call sites in the function
// immediately on entry to the current function, count it as part of the
// overall stack size.
- if (FFI->hasCalls() && RegInfo->hasReservedCallFrame(Fn))
+ if (FFI->adjustsStack() && RegInfo->hasReservedCallFrame(Fn))
Offset += FFI->getMaxCallFrameSize();
// Round up the size to a multiple of the alignment. If the function has
@@ -591,13 +591,14 @@
// otherwise, for leaf functions, align to the TransientStackAlignment
// value.
unsigned StackAlign;
- if (FFI->hasCalls() || FFI->hasVarSizedObjects() ||
+ if (FFI->adjustsStack() || FFI->hasVarSizedObjects() ||
(RegInfo->needsStackRealignment(Fn) && FFI->getObjectIndexEnd() != 0))
StackAlign = TFI.getStackAlignment();
else
StackAlign = TFI.getTransientStackAlignment();
- // If the frame pointer is eliminated, all frame offsets will be relative
- // to SP not FP; align to MaxAlign so this works.
+
+ // If the frame pointer is eliminated, all frame offsets will be relative to
+ // SP not FP. Align to MaxAlign so this works.
StackAlign = std::max(StackAlign, MaxAlign);
unsigned AlignMask = StackAlign - 1;
Offset = (Offset + AlignMask) & ~uint64_t(AlignMask);
@@ -607,7 +608,6 @@
FFI->setStackSize(Offset - LocalAreaOffset);
}
-
/// insertPrologEpilogCode - Scan the function for modified callee saved
/// registers, insert spill code for these callee saved registers, then add
/// prolog and epilog code to the function.
@@ -626,7 +626,6 @@
}
}
-
/// replaceFrameIndices - Replace all MO_FrameIndex operands with physical
/// register references and actual offsets.
///
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 17 16:19:00 2010
@@ -31,6 +31,7 @@
#include "llvm/CodeGen/FastISel.h"
#include "llvm/CodeGen/GCStrategy.h"
#include "llvm/CodeGen/GCMetadata.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionAnalysis.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
@@ -797,6 +798,19 @@
DEBUG(dbgs() << "Selected machine code:\n");
DEBUG(BB->dump());
+
+ // Determine if there are any calls in this machine function.
+ MachineFrameInfo *MFI = MF->getFrameInfo();
+ if (!MFI->hasCalls()) {
+ for (MachineBasicBlock::iterator
+ I = BB->begin(), E = BB->end(); I != E; ++I) {
+ const TargetInstrDesc &TID = TM.getInstrInfo()->get(I->getOpcode());
+ if (I->isInlineAsm() || (TID.isCall() && !TID.isReturn())) {
+ MFI->setHasCalls(true);
+ break;
+ }
+ }
+ }
}
void SelectionDAGISel::DoInstructionSelection() {
Modified: llvm/branches/Apple/Morbo/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/ARM/ARMBaseRegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -478,7 +478,7 @@
///
bool ARMBaseRegisterInfo::hasFP(const MachineFunction &MF) const {
const MachineFrameInfo *MFI = MF.getFrameInfo();
- return ((DisableFramePointerElim(MF) && MFI->hasCalls())||
+ return ((DisableFramePointerElim(MF) && MFI->adjustsStack())||
needsStackRealignment(MF) ||
MFI->hasVarSizedObjects() ||
MFI->isFrameAddressTaken());
@@ -506,7 +506,7 @@
bool ARMBaseRegisterInfo::
cannotEliminateFrame(const MachineFunction &MF) const {
const MachineFrameInfo *MFI = MF.getFrameInfo();
- if (DisableFramePointerElim(MF) && MFI->hasCalls())
+ if (DisableFramePointerElim(MF) && MFI->adjustsStack())
return true;
return MFI->hasVarSizedObjects() || MFI->isFrameAddressTaken()
|| needsStackRealignment(MF);
Modified: llvm/branches/Apple/Morbo/lib/Target/Blackfin/BlackfinRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/Blackfin/BlackfinRegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/Blackfin/BlackfinRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/Blackfin/BlackfinRegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -111,7 +111,7 @@
bool BlackfinRegisterInfo::hasFP(const MachineFunction &MF) const {
const MachineFrameInfo *MFI = MF.getFrameInfo();
return DisableFramePointerElim(MF) ||
- MFI->hasCalls() || MFI->hasVarSizedObjects();
+ MFI->adjustsStack() || MFI->hasVarSizedObjects();
}
bool BlackfinRegisterInfo::
@@ -394,7 +394,7 @@
}
if (!hasFP(MF)) {
- assert(!MFI->hasCalls() &&
+ assert(!MFI->adjustsStack() &&
"FP elimination on a non-leaf function is not supported");
adjustRegister(MBB, MBBI, dl, BF::SP, BF::P1, -FrameSize);
return;
@@ -435,7 +435,7 @@
assert(FrameSize%4 == 0 && "Misaligned frame size");
if (!hasFP(MF)) {
- assert(!MFI->hasCalls() &&
+ assert(!MFI->adjustsStack() &&
"FP elimination on a non-leaf function is not supported");
adjustRegister(MBB, MBBI, dl, BF::SP, BF::P1, FrameSize);
return;
Modified: llvm/branches/Apple/Morbo/lib/Target/CellSPU/SPURegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/CellSPU/SPURegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/CellSPU/SPURegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/CellSPU/SPURegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -447,7 +447,7 @@
assert((FrameSize & 0xf) == 0
&& "SPURegisterInfo::emitPrologue: FrameSize not aligned");
- if (FrameSize > 0 || MFI->hasCalls()) {
+ if (FrameSize > 0 || MFI->adjustsStack()) {
FrameSize = -(FrameSize + SPUFrameInfo::minStackSize());
if (hasDebugInfo) {
// Mark effective beginning of when frame pointer becomes valid.
@@ -548,7 +548,7 @@
"Can only insert epilog into returning blocks");
assert((FrameSize & 0xf) == 0
&& "SPURegisterInfo::emitEpilogue: FrameSize not aligned");
- if (FrameSize > 0 || MFI->hasCalls()) {
+ if (FrameSize > 0 || MFI->adjustsStack()) {
FrameSize = FrameSize + SPUFrameInfo::minStackSize();
if (isS10Constant(FrameSize + LinkSlotOffset)) {
// Reload $lr, adjust $sp by required amount
Modified: llvm/branches/Apple/Morbo/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/MBlaze/AsmPrinter/MBlazeAsmPrinter.cpp Mon May 17 16:19:00 2010
@@ -151,7 +151,7 @@
CPUBitmask |= (1 << MBlazeRegisterInfo::
getRegisterNumbering(RI.getFrameRegister(*MF)));
- if (MFI->hasCalls())
+ if (MFI->adjustsStack())
CPUBitmask |= (1 << MBlazeRegisterInfo::
getRegisterNumbering(RI.getRARegister()));
Modified: llvm/branches/Apple/Morbo/lib/Target/MBlaze/MBlazeRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/MBlaze/MBlazeRegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/MBlaze/MBlazeRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/MBlaze/MBlazeRegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -220,7 +220,7 @@
StackOffset += RegSize;
}
- if (MFI->hasCalls()) {
+ if (MFI->adjustsStack()) {
MBlazeFI->setRAStackOffset(0);
MFI->setObjectOffset(MFI->CreateStackObject(RegSize, RegSize, true),
StackOffset);
@@ -311,8 +311,8 @@
unsigned StackSize = MFI->getStackSize();
// No need to allocate space on the stack.
- if (StackSize == 0 && !MFI->hasCalls()) return;
- if (StackSize < 28 && MFI->hasCalls()) StackSize = 28;
+ if (StackSize == 0 && !MFI->adjustsStack()) return;
+ if (StackSize < 28 && MFI->adjustsStack()) StackSize = 28;
int FPOffset = MBlazeFI->getFPStackOffset();
int RAOffset = MBlazeFI->getRAStackOffset();
@@ -323,7 +323,7 @@
// Save the return address only if the function isnt a leaf one.
// swi R15, R1, stack_loc
- if (MFI->hasCalls()) {
+ if (MFI->adjustsStack()) {
BuildMI(MBB, MBBI, DL, TII.get(MBlaze::SWI))
.addReg(MBlaze::R15).addImm(RAOffset).addReg(MBlaze::R1);
}
@@ -366,14 +366,14 @@
// Restore the return address only if the function isnt a leaf one.
// lwi R15, R1, stack_loc
- if (MFI->hasCalls()) {
+ if (MFI->adjustsStack()) {
BuildMI(MBB, MBBI, dl, TII.get(MBlaze::LWI), MBlaze::R15)
.addImm(RAOffset).addReg(MBlaze::R1);
}
// Get the number of bytes from FrameInfo
int StackSize = (int) MFI->getStackSize();
- if (StackSize < 28 && MFI->hasCalls()) StackSize = 28;
+ if (StackSize < 28 && MFI->adjustsStack()) StackSize = 28;
// adjust stack.
// addi R1, R1, imm
Modified: llvm/branches/Apple/Morbo/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp Mon May 17 16:19:00 2010
@@ -151,7 +151,7 @@
CPUBitmask |= (1 << MipsRegisterInfo::
getRegisterNumbering(RI.getFrameRegister(*MF)));
- if (MFI->hasCalls())
+ if (MFI->adjustsStack())
CPUBitmask |= (1 << MipsRegisterInfo::
getRegisterNumbering(RI.getRARegister()));
Modified: llvm/branches/Apple/Morbo/lib/Target/Mips/MipsRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/Mips/MipsRegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/Mips/MipsRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/Mips/MipsRegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -288,7 +288,7 @@
// Stack locations for FP and RA. If only one of them is used,
// the space must be allocated for both, otherwise no space at all.
- if (hasFP(MF) || MFI->hasCalls()) {
+ if (hasFP(MF) || MFI->adjustsStack()) {
// FP stack location
MFI->setObjectOffset(MFI->CreateStackObject(RegSize, RegSize, true),
StackOffset);
@@ -302,7 +302,7 @@
MipsFI->setRAStackOffset(StackOffset);
StackOffset += RegSize;
- if (MFI->hasCalls())
+ if (MFI->adjustsStack())
TopCPUSavedRegOff += RegSize;
}
@@ -407,7 +407,7 @@
unsigned StackSize = MFI->getStackSize();
// No need to allocate space on the stack.
- if (StackSize == 0 && !MFI->hasCalls()) return;
+ if (StackSize == 0 && !MFI->adjustsStack()) return;
int FPOffset = MipsFI->getFPStackOffset();
int RAOffset = MipsFI->getRAStackOffset();
@@ -425,7 +425,7 @@
// Save the return address only if the function isnt a leaf one.
// sw $ra, stack_loc($sp)
- if (MFI->hasCalls()) {
+ if (MFI->adjustsStack()) {
BuildMI(MBB, MBBI, dl, TII.get(Mips::SW))
.addReg(Mips::RA).addImm(RAOffset).addReg(Mips::SP);
}
@@ -477,7 +477,7 @@
// Restore the return address only if the function isnt a leaf one.
// lw $ra, stack_loc($sp)
- if (MFI->hasCalls()) {
+ if (MFI->adjustsStack()) {
BuildMI(MBB, MBBI, dl, TII.get(Mips::LW), Mips::RA)
.addImm(RAOffset).addReg(Mips::SP);
}
Modified: llvm/branches/Apple/Morbo/lib/Target/PowerPC/PPCRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/PowerPC/PPCRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -1005,7 +1005,7 @@
if (!DisableRedZone &&
FrameSize <= 224 && // Fits in red zone.
!MFI->hasVarSizedObjects() && // No dynamic alloca.
- !MFI->hasCalls() && // No calls.
+ !MFI->adjustsStack() && // No calls.
(!ALIGN_STACK || MaxAlign <= TargetAlign)) { // No special alignment.
// No need for frame
MFI->setStackSize(0);
Modified: llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp Mon May 17 16:19:00 2010
@@ -5259,7 +5259,7 @@
}
// TLSADDR will be codegen'ed as call. Inform MFI that function has calls.
- MFI->setHasCalls(true);
+ MFI->setAdjustsStack(true);
SDValue Flag = Chain.getValue(1);
return DAG.getCopyFromReg(Chain, dl, ReturnReg, PtrVT, Flag);
Modified: llvm/branches/Apple/Morbo/lib/Target/X86/X86RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/X86/X86RegisterInfo.cpp?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/X86/X86RegisterInfo.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/X86/X86RegisterInfo.cpp Mon May 17 16:19:00 2010
@@ -906,7 +906,7 @@
if (Is64Bit && !Fn->hasFnAttr(Attribute::NoRedZone) &&
!needsStackRealignment(MF) &&
!MFI->hasVarSizedObjects() && // No dynamic alloca.
- !MFI->hasCalls() && // No calls.
+ !MFI->adjustsStack() && // No calls.
!Subtarget->isTargetWin64()) { // Win64 has no Red Zone
uint64_t MinSize = X86FI->getCalleeSavedFrameSize();
if (HasFP) MinSize += SlotSize;
Modified: llvm/branches/Apple/Morbo/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll?rev=103978&r1=103977&r2=103978&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll (original)
+++ llvm/branches/Apple/Morbo/test/CodeGen/SystemZ/2009-07-10-BadIncomingArgOffset.ll Mon May 17 16:19:00 2010
@@ -1,4 +1,4 @@
-; RUN: llc < %s | grep 168
+; RUN: llc < %s | FileCheck %s
target datalayout = "E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16"
target triple = "s390x-linux"
@@ -8,6 +8,8 @@
declare double @mp_mul_d2i_test(i32 signext, i32 signext, double* nocapture) nounwind
define void @mp_mul_radix_test_bb3(i32 %radix, i32 %nfft, double* %tmpfft, i32* %ip, double* %w, double* %arrayidx44.reload, double* %call.out) nounwind {
+; CHECK: lg %r11, 328(%r15)
+
newFuncRoot:
br label %bb3
More information about the llvm-branch-commits
mailing list