PGO: allows the profile data file name to be specified by the LLVMPROF_OUTPUT
environment variable.

This allows parallel make for profiling code, without it there are file
collisions as each parallel run uses the default file name.

There is already code in the runtime library to specify the output file name
via the command line, but this only works for programs which already process
argc/argv.  This patch builds on that support.

Patch by Alastair Murray.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167269 91177308-0d34-0410-b5e6-96231b3b80d8
libprofile/CommonProfiling.c: Fix according to C89.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167272 91177308-0d34-0410-b5e6-96231b3b80d8
Fix sign compare warning. Patch by Mahesha HS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167282 91177308-0d34-0410-b5e6-96231b3b80d8
Fix an obvious typo that causes an assertion failure when running
test/Transforms/GVN/rle.ll if the (currently disabled) check for a
pointer type in getIntPtrType is turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167285 91177308-0d34-0410-b5e6-96231b3b80d8
Revert the switch of loop-idiom to use the new dependence analysis.

The new analysis is not yet ready for prime time. It has a *critical*
flawed assumption, and some troubling shortages of testing. Until it's
been hammered into better shape, let's stick with the working code. This
should be easy to revert itself when the analysis is ready.

Fixes PR14241, a miscompile of any memcpy-able loop which uses a pointer
as the induction mechanism. If you have been seeing miscompiles in this
revision range, you really want to test with this backed out. The
results of this miscompile are a bit subtle as they can lead to
downstream passes concluding things are impossible which are in fact
possible.

Thanks to David Blaikie for the majority of the reduction of this
miscompile. I'll be checking in the test case in a non-revert commit.

Revesions reverted here:

r167045: LoopIdiom: Fix a serious missed optimization: we only turned
         top-level loops into memmove.
r166877: LoopIdiom: Add checks to avoid turning memmove into an infinite
         loop.
r166875: LoopIdiom: Recognize memmove loops.
r166874: LoopIdiom: Replace custom dependence analysis with
         DependenceAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167286 91177308-0d34-0410-b5e6-96231b3b80d8
Add a testcase to loop-idiom to cover PR14241 when we start handling
strided loops again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167287 91177308-0d34-0410-b5e6-96231b3b80d8
Enable the assertion in getIntPtrType (I've audited all users of this method and
they are now all correct; hopefully the buildbots will agree!).


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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167302 91177308-0d34-0410-b5e6-96231b3b80d8
Change resolveRelocation parameters so the relocations can find placeholder values in the original object buffer.

Some ELF relocations require adding the a value to the original contents of the object buffer at the specified location.  In order to properly handle multiple applications of a relocation, the RuntimeDyld code should be grabbing the original value from the object buffer and writing a new value into the loaded section buffer.  This patch changes the parameters passed to resolveRelocations to accommodate this need.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167304 91177308-0d34-0410-b5e6-96231b3b80d8
XLC supports the same atomic functions as GCC, use them.
Patch by Kai.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167309 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Delete MipsFunctionInfo::EmitNOAT. Unconditionally print directive
"set .noat" so that the assembler doesn't issue warnings when register $AT is
used.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167310 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a build problem with xlc. The error message was

"../llvm-git/utils/TableGen/CodeGenSchedule.cpp", line 1594.12: 1540-0218 (S) The call does not match any parameter list for "operator+".
"../llvm-git/include/llvm/ADT/STLExtras.h", line 130.1: 1540-1283 (I) "template <class _Iterator, class Func> llvm::operator+(mapped_iterator<_Iterator,Func>::difference_type, const mapped_iterator<_Iterator,Func> &)" is not a viable candidate.

Patch by Kai.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167311 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Add member field MipsFunctionInfo::IncomingArgSize which holds the size
of the incoming argument area.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167312 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Add function MipsFrameLowering::estimateStackSize.

This function estimates stack size and will be called before
PrologEpilogInserter scans the callee-saved registers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167313 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Use register number instead of name to print register $AT.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167315 91177308-0d34-0410-b5e6-96231b3b80d8
Vext Lowering was missing opportunities

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167318 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] Fix bug in test case. Disable machine LICM to prevent instruction from
being moved out of a basic block.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167322 91177308-0d34-0410-b5e6-96231b3b80d8
Scalar Bitcasts and Truncs are usually free

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167323 91177308-0d34-0410-b5e6-96231b3b80d8
Add a cost model analysis that allows us to estimate the cost of IR-level instructions.

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