TargetLibraryInfo: add strn?cat, strn?cpy, and strn?len

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160678 91177308-0d34-0410-b5e6-96231b3b80d8
Add new interfaces to support ldd's ReaderElf.cpp.

Patch by Sid Manning!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160685 91177308-0d34-0410-b5e6-96231b3b80d8
ELF does not imply GNU/Linux.  Do not assume GNU conventions just because we
are targeting an ELF platform.  Only fold gs-relative (and fs-relative) loads
if it is actually sensible to do so for the target platform.

This fixes PR13438.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160687 91177308-0d34-0410-b5e6-96231b3b80d8
add a few more functions to TargetLibraryInfo:
fputc, memchr, memcmp, putchar, puts, strchr, strncmp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160690 91177308-0d34-0410-b5e6-96231b3b80d8
[Object] Remove unneeded const_cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160692 91177308-0d34-0410-b5e6-96231b3b80d8
Don't delete one more instruction than we're allowed to. This should fix the
Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit
the testcase this evening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160693 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a bug in the x86 disassembler's symbolic disassembly support for Jcc-Jump
if Condition Is Met instuctions that was not correctly determining the target
instruction.

So for a jne rel32 instruction:

% cat x.s
.byte 0x0f, 0x85, 0x09, 0x00, 0x00, 0x00
% as x.s

it was incorrectly deterining the target:

% otool -q -tv a.out 
a.out:
(__TEXT,__text) section
0000000000000000	jne	0xd

and with the fix it gets this correct as:

% otool -q -tv a.out
a.out:
(__TEXT,__text) section
0000000000000000	jne	0xf

rdar://11505997


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160694 91177308-0d34-0410-b5e6-96231b3b80d8
In order to correctly compile

struct s {
  double x1;
  float x2;
};
__attribute__((regparm(3))) struct s f(int a, int b, int c);
void g(void) {
  f(41, 42, 43);
}

We need to be able to represent passing the address of s to f (sret) in a
register (inreg). Turns out that all that is needed is to not mark them as
mutually incompatible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160695 91177308-0d34-0410-b5e6-96231b3b80d8
Add a triple to the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160698 91177308-0d34-0410-b5e6-96231b3b80d8
Add a cpu to the test. Should fix the atom bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160701 91177308-0d34-0410-b5e6-96231b3b80d8
Eliminate the stack slot used to save the global base register.
 
The long branch pass (fixed in r160601) no longer uses the global base register
to compute addresses of branch destinations, so it is not necessary to reserve
a slot on the stack.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160703 91177308-0d34-0410-b5e6-96231b3b80d8
When folding a load from a global constant, if the load started in the middle
of an array element (rather than at the beginning of the element) and extended
into the next element, then the load from the second element was being handled
wrong due to incorrect updating of the notion of which byte to load next.  This
fixes PR13442.  Thanks to Chris Smowton for reporting the problem, analyzing it
and providing a fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160711 91177308-0d34-0410-b5e6-96231b3b80d8
Don't perform an overaligned load in this test, since that's undefined
behaviour that might be exploited one day.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160714 91177308-0d34-0410-b5e6-96231b3b80d8
Factor a long list of conditions into a predicate function. No functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160724 91177308-0d34-0410-b5e6-96231b3b80d8
When a return struct pointer is passed in registers, the called has nothing
to pop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160725 91177308-0d34-0410-b5e6-96231b3b80d8
Twine: fix link to source, add link to class doc and container section.
80 char lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160726 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typos. Thanks to Matt Beaumont-Gay for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160731 91177308-0d34-0410-b5e6-96231b3b80d8
make all Emit*() functions consult the TargetLibraryInfo information before creating a call to a library function.
Update all clients to pass the TLI information around.
Previous draft reviewed by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160733 91177308-0d34-0410-b5e6-96231b3b80d8
Verify two-address constraints more carefully.

Include <undef> operands and virtual registers after leaving SSA form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160734 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: Don't assume an SDNode is a constant.

Before accessing a node as a ConstandSDNode, make sure it actually is one.
No testcase of non-trivial size.

rdar://11948669

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