Insert instructions to the entry basic block which initializes the global
authorAkira Hatanaka <ahatanaka@mips.com>
Sat, 12 May 2012 00:17:17 +0000 (00:17 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Sat, 12 May 2012 00:17:17 +0000 (00:17 +0000)
commit27ba61df9f9decc70124b7559f777ad596dfda29
tree640b855b929dd42f5560a1d3e97fe3fa1cebfe85
parentb08174c0b1ed7a8c3cacc5df506eb98c79305a4e
Insert instructions to the entry basic block which initializes the global
pointer register.

This is the first of the series of patches which clean up the way global pointer
register is used. The patches will make the following improvements:

- Make $gp an allocatable temporary register rather than reserving it.
- Use a virtual register as the global pointer register and let the register
  allocator decide which register to assign to it or whether spill/reloads are
  needed.
- Make sure $gp is valid at the entry of a called function, which is necessary
  for functions using lazy binding.
- Remove the need for emitting .cprestore and .cpload directives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156671 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsISelDAGToDAG.cpp
test/CodeGen/Mips/tls.ll
test/MC/Mips/sym-offset.ll