[AlignmentFromAssumptions] Don't divide by zero for unknown starting alignment

The routine that determines an alignment given some SCEV returns zero if the
answer is unknown. In a case where we could determine the increment of an
AddRec but not the starting alignment, we would compute the integer modulus by
zero (which is illegal and traps). Prevent this by returning early if either
the start or increment alignment is unknown (zero).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217544 91177308-0d34-0410-b5e6-96231b3b80d8
Enable use of __builtin_assume_aligned when self-hosting

Clang/LLVM trunk now have support for __builtin_assume_aligned, turn this &&
into an || so we can use it ourselves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217545 91177308-0d34-0410-b5e6-96231b3b80d8
Add doInitialization/doFinalization to DataLayoutPass.

With this a DataLayoutPass can be reused for multiple modules.

Once we have doInitialization/doFinalization, it doesn't seem necessary to pass
a Module to the constructor.

Overall this change seems in line with the idea of making DataLayout a required
part of Module. With it the only way of having a DataLayout used is to add it
to the Module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217548 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Custom lower frem

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217553 91177308-0d34-0410-b5e6-96231b3b80d8
Add LLVMgold target to test dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217557 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Report offset in correct units for st64 DS instructions

Need to convert the 64 element offset into bytes, not just the element
size like the normal case instructions.

Noticed by inspection. This can't be hit now because
st64 instructions aren't emitted during instruction selection,
and the post-RA scheduler isn't enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217560 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Fix losing chain when fixing reg class of loads.

The lost chain resulting in earlier side effecting nodes
being deleted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217561 91177308-0d34-0410-b5e6-96231b3b80d8
shared_ptrify ownershp of PoolEntries in PBQP's CostPool

Leveraging both intrusive shared_ptr-ing (std::enable_shared_from_this)
and shared_ptr<T>-owning-U (to allow external users to hold
std::shared_ptr<CostT> while keeping the underlying PoolEntry alive).

The intrusiveness could be removed if we had a weak_set that implicitly
removed items from the set when their underlying data went away.

This /might/ fix an existing memory leak reported by LeakSanitizer in
r217504.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217563 91177308-0d34-0410-b5e6-96231b3b80d8
Use CostPool::PoolRef typedef some more

Cleanup to 217563 suggested by Lang Hames in post-commit review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217564 91177308-0d34-0410-b5e6-96231b3b80d8
[x86] FileCheck-ize this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217565 91177308-0d34-0410-b5e6-96231b3b80d8
utils: Teach lldbDataFormatters how to format ArrayRefs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217567 91177308-0d34-0410-b5e6-96231b3b80d8
Build correct vector filled with undef nodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217570 91177308-0d34-0410-b5e6-96231b3b80d8
[AlignmentFromAssumptions] Don't crash just because the target is 32-bit

We used to crash processing any relevant @llvm.assume on a 32-bit target
(because we'd ask SE to subtract expressions of differing types). I've copied
our 'simple.ll' test, but with the data layout from arm-linux-gnueabihf to get
some meaningful test coverage here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217574 91177308-0d34-0410-b5e6-96231b3b80d8
[x86] Fixup r217565 which baked in an assumption about the function
name that breaks on some platforms. This part of the test just doesn't
matter...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217575 91177308-0d34-0410-b5e6-96231b3b80d8
[ARM] Add Thumb2 code size optimization regression test for LSL (immediate).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217576 91177308-0d34-0410-b5e6-96231b3b80d8
[ARM] Add Thumb-2 code size optimization regression test for LSL (register).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217579 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Reenable the PBQP test now that the leak issue has been fixed.

David Blaikie's commits r217563 & r217564, which added shared_ptr to the
CostPool have fixed some memory leak issues exposed by the PBQP with
coalescing constraints.

The sanitizer bot was failing because of those leaks. Now that the leaks
are gone, we can reenable the aarch64/pbqp test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217580 91177308-0d34-0410-b5e6-96231b3b80d8
[ARM] Add Thumb-2 code size optimization regression test for LSR (immediate).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217581 91177308-0d34-0410-b5e6-96231b3b80d8
[ARM] Add Thumb-2 code size optimization regression test for LSR (register).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217582 91177308-0d34-0410-b5e6-96231b3b80d8
[docs] Mention character array constants in docs/LangRef.rst

Summary:
They were used in the 'Module Structure' example but weren't otherwise
documented.

Credit to Reed Kotler for noticing.

Reviewers: hans

Reviewed By: hans

Subscribers: hans, llvm-commits

Differential Revision: http://reviews.llvm.org/D5191

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