diff options
author | Hal Finkel <hfinkel@anl.gov> | 2015-01-18 12:08:47 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2015-01-18 12:08:47 +0000 |
commit | f81b6dd7a2f5eced5e4acf20227edc062a45205f (patch) | |
tree | ee5e36e7fc3ded98e1dd79ec541cfb0cb9b77e9e /llvm/lib/Target/PowerPC/PPCFastISel.cpp | |
parent | 5ec3333d2401eaa1e9454e0eaf60d74889c01fda (diff) | |
download | llvm-f81b6dd7a2f5eced5e4acf20227edc062a45205f.zip llvm-f81b6dd7a2f5eced5e4acf20227edc062a45205f.tar.gz llvm-f81b6dd7a2f5eced5e4acf20227edc062a45205f.tar.bz2 |
[PowerPC] Initial PPC64 calling-convention changes for fastcc
The default calling convention specified by the PPC64 ELF (V1 and V2) ABI is
designed to work with both prototyped and non-prototyped/varargs functions. As
a result, GPRs and stack space are allocated for every argument, even those
that are passed in floating-point or vector registers.
GlobalOpt::OptimizeFunctions will transform local non-varargs functions (that
do not have their address taken) to use the 'fast' calling convention.
When functions are using the 'fast' calling convention, don't allocate GPRs for
arguments passed in other types of registers, and don't allocate stack space for
arguments passed in registers. Other changes for the fast calling convention
may be added in the future.
llvm-svn: 226399
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCFastISel.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCFastISel.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCFastISel.cpp b/llvm/lib/Target/PowerPC/PPCFastISel.cpp index 13bd0c7..7af601e 100644 --- a/llvm/lib/Target/PowerPC/PPCFastISel.cpp +++ b/llvm/lib/Target/PowerPC/PPCFastISel.cpp @@ -1275,7 +1275,7 @@ bool PPCFastISel::processCallArgs(SmallVectorImpl<Value*> &Args, // Prepare to assign register arguments. Every argument uses up a // GPR protocol register even if it's passed in a floating-point - // register. + // register (unless we're using the fast calling convention). unsigned NextGPR = PPC::X3; unsigned NextFPR = PPC::F1; @@ -1325,7 +1325,8 @@ bool PPCFastISel::processCallArgs(SmallVectorImpl<Value*> &Args, unsigned ArgReg; if (ArgVT == MVT::f32 || ArgVT == MVT::f64) { ArgReg = NextFPR++; - ++NextGPR; + if (CC != CallingConv::Fast) + ++NextGPR; } else ArgReg = NextGPR++; |