diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-06-23 14:15:53 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-06-23 14:15:53 +0000 |
commit | 8ca988f31afb8f9b779963e8fabfbe336b865d2c (patch) | |
tree | 45781ac6da1b8a6c1a63450bac5c5f5fc31f2869 /llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | |
parent | bfdb1c0c2f81f57dc5ebeb8671735c4028589ece (diff) | |
download | bcm5719-llvm-8ca988f31afb8f9b779963e8fabfbe336b865d2c.tar.gz bcm5719-llvm-8ca988f31afb8f9b779963e8fabfbe336b865d2c.zip |
[PowerPC] Refactor getMinCallFrameSize / getMinCallArgumentsSize
As of r211495, the only remaining users of getMinCallFrameSize are in
core ABI code (LowerFormalParameter / LowerCall). This is actually a
good thing, since the details of the parameter save area are ABI specific.
With the new ELFv2 ABI in particular, the rules defining the size of the
save area will become significantly more complex, so it wouldn't make
sense to implement those outside ABI code that has all required
information.
In preparation, this patch eliminates the getMinCallFrameSize (and
associated getMinCallArgumentsSize) routines, and inlines them into all
callers. Note that since nearly all call arguments are constant, this
allows simplifying the inlined copies to a single line everywhere.
No change in generate code expected.
llvm-svn: 211497
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCFrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp index ef4ea77bfca..65e9cf2b43a 100644 --- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp @@ -41,30 +41,6 @@ PPCFrameLowering::PPCFrameLowering(const PPCSubtarget &STI) (STI.hasQPX() || STI.isBGQ()) ? 32 : 16, 0), Subtarget(STI) {} -unsigned PPCFrameLowering::getMinCallArgumentsSize(bool isPPC64, - bool isDarwinABI) { - // For the Darwin ABI / 64-bit SVR4 ABI: - // The prolog code of the callee may store up to 8 GPR argument registers to - // the stack, allowing va_start to index over them in memory if its varargs. - // Because we cannot tell if this is needed on the caller side, we have to - // conservatively assume that it is needed. As such, make sure we have at - // least enough stack space for the caller to store the 8 GPRs. - if (isDarwinABI || isPPC64) - return 8 * (isPPC64 ? 8 : 4); - - // 32-bit SVR4 ABI: - // There is no default stack allocated for the 8 first GPR arguments. - return 0; -} - -/// getMinCallFrameSize - Return the minimum size a call frame can be using -/// the PowerPC ABI. -unsigned PPCFrameLowering::getMinCallFrameSize(bool isPPC64, bool isDarwinABI) { - // The call frame needs to be at least big enough for linkage and 8 args. - return PPCFrameLowering::getLinkageSize(isPPC64, isDarwinABI) + - PPCFrameLowering::getMinCallArgumentsSize(isPPC64, isDarwinABI); -} - // With the SVR4 ABI, callee-saved registers have fixed offsets on the stack. const PPCFrameLowering::SpillSlot *PPCFrameLowering::getCalleeSavedSpillSlots( unsigned &NumEntries) const { |