move WITH_POLLY option before add_subdirectory(tools)

the first run of the polly buildbot failed, and then it started passing.
This is due to the fact that the buildbot re-builds in an existing directory,
and the first run does not have WITH_POLLY set when it enters tools/.
Thus, cmake ignores the tools/polly dir in the first run, and then because
it reuses the CMakeCache.txt of the previous run, it has the WITH_POLLY set
by the previous run, and so it passes the second time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203615 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up test/DebugInfo/empty.ll now that we have an alias for "llc with dwarf output"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203616 91177308-0d34-0410-b5e6-96231b3b80d8
Accept Twine's to AsmPrinter::getTempSymbol (refactoring for an incoming change)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203617 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Refactor emitDebugPubNames/Types into a common implementation

I could fold the callers into their one call site, but the indirection
(given how verbose choosing the section is) seemed helpful.

The use of a member function pointer's a bit "tricky", but seems limited
enough, the call sites are simple/clean/clear, and there's only one use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203619 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Avoid re-looking up the DwarfUnit when emitting pubnames/pubtypes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203620 91177308-0d34-0410-b5e6-96231b3b80d8
Test for empty pubnames/pubtypes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203621 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Do not emit pubnames/pubtypes sections if they are empty

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203622 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Omit pubnames/pubtypes when compiling with -gmlt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203634 91177308-0d34-0410-b5e6-96231b3b80d8
[ARM] Use DWARF register numbers for CFI directives in ELF assembly

It seems gas can't handle CFI directives with VFP register names ("d12", etc.).
This broke us trying to build Chromium for Android after 201423.

A gas bug has been filed: https://sourceware.org/bugzilla/show_bug.cgi?id=16694

compnerd suggested making this conditional on whether we're using the integrated
assembler or not. I'll look into that in a follow-up patch.

Differential Revision: http://llvm-reviews.chandlerc.com/D3049

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203635 91177308-0d34-0410-b5e6-96231b3b80d8
Replace '#include ValueTypes.h' with forward declarations.

In some cases the include is pushed "downstream" (or removed if
unused).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203644 91177308-0d34-0410-b5e6-96231b3b80d8
ARM: correct Dwarf output for non-contiguous VFP saves.

When the list of VFP registers to be saved was non-contiguous (so multiple
vpush/vpop instructions were needed) these were being ordered oddly, as in:
    vpush {d8, d9}
    vpush {d11}

This led to the layout in memory being [d11, d8, d9] which is ugly and doesn't
match the CFI_INSTRUCTIONs we're generating either (so Dwarf info would be
broken).

This switches the order of vpush/vpop (in both prologue and epilogue,
obviously) so that the Dwarf locations are correct again.

rdar://problem/16264856

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203655 91177308-0d34-0410-b5e6-96231b3b80d8
[mips] BSEL's and BINS[RL] operands are reversed compared to the vselect node used in the pattern.

Summary:
Correct the match patterns and the lowerings that made the CodeGen tests pass despite the mistakes.

The original testcase that discovered the problem was SingleSource/UnitTests/SignlessType/factor.c in test-suite.
During review, we also found that some of the existing CodeGen tests were incorrect and fixed them:
* bitwise.ll: In bsel_v16i8 the IfSet/IfClear were reversed because bsel and bmnz have different operand orders and the test didn't correctly account for this. bmnz goes 'IfClear, IfSet, CondMask', while bsel goes 'CondMask, IfClear, IfSet'.
* vec.ll: In the cases where a bsel is emitted as a bmnz (they are the same operation with a different input tied to the result) the operands were in the wrong order.
* compare.ll and compare_float.ll: The bsel operand order was correct for a greater-than comparison, but a greater-than comparison instruction doesn't exist. Lowering this operation inverts the condition so the IfSet/IfClear need to be swapped to match.

The differences between BSEL, BMNZ, and BMZ and how they map to/from vselect are rather confusing. I've therefore added a note to MSA.txt to explain this in a single place in addition to the comments that explain each case.

Reviewers: matheusalmeida, jacksprat

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203657 91177308-0d34-0410-b5e6-96231b3b80d8
[mips][fp64] Add an implicit def to MTHC1 claiming that it reads the lower 32-bits of 64-bit FPR

Summary:
This is a white lie to workaround a widespread bug in the -mfp64
implementation.

The problem is that none of the 32-bit fpu ops mention the fact that they
clobber the upper 32-bits of the 64-bit FPR. This allows MTHC1 to be
scheduled on the wrong side of most 32-bit FPU ops, particularly MTC1.
Fixing that requires a major overhaul of the FPU implementation which can't
be done right now due to time constraints.

The testcase is SingleSource/Benchmarks/Misc/oourafft.c when given
TARGET_CFLAGS='-mips32r2 mfp64 -mmsa'.

Also correct the comment added in r203464 to indicate that two
instructions were affected.

Reviewers: matheusalmeida, jacksprat

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D3029

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203659 91177308-0d34-0410-b5e6-96231b3b80d8
Cloning a function now also clones its debug metadata if 'ModuleLevelChanges' is true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203662 91177308-0d34-0410-b5e6-96231b3b80d8
Update the datalayout string for ppc64LE.

Update the datalayout string for ppc64LE.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203664 91177308-0d34-0410-b5e6-96231b3b80d8
Move duplicated code into a helper function (exposed through overload).

There's a bit of duplicated "magic" code in opt.cpp and Clang's CodeGen that
computes the inliner threshold from opt level and size opt level.

This patch moves the code to a function that lives alongside the inliner itself,
providing a convenient overload to the inliner creation.

A separate patch can be committed to Clang to use this once it's committed to
LLVM. Standalone tools that use the inlining pass can also avoid duplicating
this code and fearing it will go out of sync.

Note: this patch also restructures the conditinal logic of the computation to
be cleaner.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203669 91177308-0d34-0410-b5e6-96231b3b80d8
Add comment pointing to the binutils bugzilla entry

This is a follow-up to r203635 as suggested by Rafael.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203670 91177308-0d34-0410-b5e6-96231b3b80d8
Add parens around && clauses in a || to appease the compiler.

Otherwise gcc 4.8.2 generates a warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203671 91177308-0d34-0410-b5e6-96231b3b80d8
Revive SizeOptLevel-explaining comments that were dropped in r203669


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203675 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Use common line/file attribute construction code

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