Fix PR13969, a mini-phase-ordering issue with the new SROA pass.

Currently, we re-visit allocas when something changes about the way they
might be *split* to allow better scalarization to take place. However,
we weren't handling the case when the *promotion* is what would change
the behavior of SROA. When an address derived from an alloca is stored
into another alloca, we consider the first to have escaped. If the
second is ever promoted to an SSA value, we will suddenly be able to run
the SROA pass on the first alloca.

This patch adds explicit support for this form if iteration. When we
detect a store of a pointer derived from an alloca, we flag the
underlying alloca for reprocessing after promotion. The logic works hard
to only do this when there is definitely going to be promotion and it
might remove impediments to the analysis of the alloca.

Thanks to Nick for the great test case and Benjamin for some sanity
check review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165223 91177308-0d34-0410-b5e6-96231b3b80d8
Fix wrong name in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165224 91177308-0d34-0410-b5e6-96231b3b80d8
Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165225 91177308-0d34-0410-b5e6-96231b3b80d8
The alignment of an sret parameter is known: it must be at least the
alignment of the return type.  Teach the optimizers this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165226 91177308-0d34-0410-b5e6-96231b3b80d8
In my recent change to avoid use of underaligned memory I didn't notice that
cpyDest can be mutated in some cases, which would then cause a crash later if
indeed the memory was underaligned.  This brought down several buildbots, so
I guess the underaligned case is much more common than I thought!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165228 91177308-0d34-0410-b5e6-96231b3b80d8
SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.

We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165233 91177308-0d34-0410-b5e6-96231b3b80d8
Switch MachineTraceMetrics to the new TargetSchedModel interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165235 91177308-0d34-0410-b5e6-96231b3b80d8
Get MCSchedModel directly from the subtarget.

Not all targets have itineraries, but the subtarget always has an
MCSchedModel.

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

- add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
"Instruction 'foo' has no tokens" errors during llvm-tblgen
-gen-asm-matcher attempts.  At this time, the added
tokens are "#comment" style rather than the actual mnemonic.  This will
be revisited once the rest of the base asmparser bits get straightened
out for ppc64-elf-linux.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165237 91177308-0d34-0410-b5e6-96231b3b80d8
Add a comment to the commit r165187.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165238 91177308-0d34-0410-b5e6-96231b3b80d8
Fix doxygen comment to match parameters' names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165239 91177308-0d34-0410-b5e6-96231b3b80d8
Add register encoding support in X86 backend

- Add 'HwEncoding' for X86 registers and call getEncodingValue() to
  retrieve their encoding values.
- This's the first step to adopt new scheme. Furthur revising is onging.



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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165243 91177308-0d34-0410-b5e6-96231b3b80d8
Accidently checked in the files, only wanted to copy them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165244 91177308-0d34-0410-b5e6-96231b3b80d8
Adding MCJIT and MemoryBuffer unit tests

Patch by Daniel Malea.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165246 91177308-0d34-0410-b5e6-96231b3b80d8
Create the DataLayout class, as a direct copy of TargetData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165249 91177308-0d34-0410-b5e6-96231b3b80d8
Update this a bit more to represent how the prologue should work:

a) frame setup instructions define the prologue
b) we shouldn't change our location mid-stream

Add a test to make sure that the stack adjustment stays within
the prologue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165250 91177308-0d34-0410-b5e6-96231b3b80d8
Rename TargetData to DataLayout in DataLayout.cpp. This should fix a build failure from r165249 where the wrong version of the file was submitted.

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