This patch is for the implementation of mips16 complex pattern addr16.
Previously mips16 was sharing the pattern addr which is used for mips32
and mips64. This had a number of problems:
1) Storing and loading byte and halfword quantities for mips16 has particular
problems due to the primarily non mips16 nature of SP. When we must
load/store byte/halfword stack objects in a function, we must create a mips16
alias register for SP. This functionality is tested in stchar.ll.
2) We need to have an FP register under certain conditions (such as 
dynamically sized alloca). We use mips16 register S0 for this purpose.
In this case, we also use this register when accessing frame objects so this
issue also affects the complex pattern addr16. This functionality is
tested in alloca16.ll.

The Mips16InstrInfo.td has been updated to use addr16 instead of addr.

The complex pattern C++ function for addr has been copied to addr16 and
updated to reflect the above issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166897 91177308-0d34-0410-b5e6-96231b3b80d8
Remove TargetELFWriterInfo.
All the credit goes to Jan Voung for noticing it was dead!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166902 91177308-0d34-0410-b5e6-96231b3b80d8
Implement brind operator for mips16.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166903 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-extract was unable to handle aliases. It would leave a copy on the
output of both

llvm-extract foo.ll -func=bar
and
llvm-extract foo.ll -func=bar -delete

so the two new files could not be linked together anymore. With this change
alias are handled almost like functions and global variables. Almost because
with alias we cannot just clear the initializer/body, we have to create a new
declaration and replace the alias with it.

The net result is that now the output of the above commands can be linked
even if foo.ll has aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166907 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-extract changes linkages so that functions on both sides of the
split module can see each other. If it is keeping a symbol that already has
a non local linkage, it doesn't need to change it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166908 91177308-0d34-0410-b5e6-96231b3b80d8
Add -alias and -ralias options to match what we have for functions and
globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166909 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unused typedef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166910 91177308-0d34-0410-b5e6-96231b3b80d8
Calling TLI->getNumRegisters creates a circular dependency when building LLVM using cmake.

Get the number of registers by calling getTypeLegalizationCost.

PR14199.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166911 91177308-0d34-0410-b5e6-96231b3b80d8
va_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166916 91177308-0d34-0410-b5e6-96231b3b80d8
Add interface for querying object files for symbol values.

Currently only implemented for ELF.

Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166918 91177308-0d34-0410-b5e6-96231b3b80d8
Make use of common-symbol alignment info in ELF loader.

Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166919 91177308-0d34-0410-b5e6-96231b3b80d8
Align the data section correctly when loading an ELF file.

Patch by Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166920 91177308-0d34-0410-b5e6-96231b3b80d8
Silence a GCC warning about comparing signed and unsigned types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166922 91177308-0d34-0410-b5e6-96231b3b80d8
Rather than duplicating the getPointerSize code just call getPointerSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166923 91177308-0d34-0410-b5e6-96231b3b80d8
Loads and stores without an explicit alignment use the abi alignment not the
preferred alignment.  Correct the documentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166925 91177308-0d34-0410-b5e6-96231b3b80d8
Factorize code: rather than duplication the logic in getPointerTypeSizeInBits,
just call getPointerTypeSizeInBits.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166926 91177308-0d34-0410-b5e6-96231b3b80d8
This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing logic is used as a fallback to avoid any changes to the Darwin
ABI.  PPC64 ELF now has two possible data layout strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in Clang, which I am committing now as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166928 91177308-0d34-0410-b5e6-96231b3b80d8
This patch addresses a problem with the Post RA scheduler generating an
incorrect instruction sequence due to it not being aware that an
inline assembly instruction may reference memory.

This patch fixes the problem by causing the scheduler to always assume that any
inline assembly code instruction could access memory. This is necessary because
the internal representation of the inline instruction does not include
any information about memory accesses.
 
This should fix PR13504.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166929 91177308-0d34-0410-b5e6-96231b3b80d8
PPCSubtarget.h: Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166931 91177308-0d34-0410-b5e6-96231b3b80d8
PPCSubtarget.h: Add explicit braces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166932 91177308-0d34-0410-b5e6-96231b3b80d8