summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsSEISelLowering.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2013-11-27 23:38:42 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2013-11-27 23:38:42 +0000
commitbd448674777fc0c88c8503015d5c74615ccc66ea (patch)
tree688088a1c5b9d7915c0f0c306a1af12684060829 /lib/Target/Mips/MipsSEISelLowering.cpp
parentd99338105b607f0d0b33144515ad34c90da1d21c (diff)
downloadllvm-bd448674777fc0c88c8503015d5c74615ccc66ea.tar.gz
llvm-bd448674777fc0c88c8503015d5c74615ccc66ea.tar.bz2
llvm-bd448674777fc0c88c8503015d5c74615ccc66ea.tar.xz
[mips] Implement the following optimizations using dominance information to
make PIC calls a little more efficient: 1. Remove instructions setting up $gp if it is known that a function has been called at least once. 2. Save the address of a called function in a register instead of loading it from the GOT at every call site. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsSEISelLowering.cpp')
-rw-r--r--lib/Target/Mips/MipsSEISelLowering.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/Target/Mips/MipsSEISelLowering.cpp b/lib/Target/Mips/MipsSEISelLowering.cpp
index 809adc03b1..cc6411fd88 100644
--- a/lib/Target/Mips/MipsSEISelLowering.cpp
+++ b/lib/Target/Mips/MipsSEISelLowering.cpp
@@ -1077,14 +1077,7 @@ getOpndList(SmallVectorImpl<SDValue> &Ops,
std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage,
CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const {
- // T9 should contain the address of the callee function if
- // -reloction-model=pic or it is an indirect call.
- if (IsPICCall || !GlobalOrExternal) {
- unsigned T9Reg = IsN64 ? Mips::T9_64 : Mips::T9;
- RegsToPass.push_front(std::make_pair(T9Reg, Callee));
- } else
- Ops.push_back(Callee);
-
+ Ops.push_back(Callee);
MipsTargetLowering::getOpndList(Ops, RegsToPass, IsPICCall, GlobalOrExternal,
InternalLinkage, CLI, Callee, Chain);
}