Use rsqrt (X86) to speed up reciprocal square root calcs

This is a first step for generating SSE rsqrt instructions for
reciprocal square root calcs when fast-math is allowed.

For now, be conservative and only enable this for AMD btver2
where performance improves significantly - for example, 29%
on llvm/projects/test-suite/SingleSource/Benchmarks/BenchmarkGame/n-body.c
(if we convert the data type to single-precision float).

This patch adds a two constant version of the Newton-Raphson
refinement algorithm to DAGCombiner that can be selected by any target
via a parameter returned by getRsqrtEstimate()..

See PR20900 for more details:
http://llvm.org/bugs/show_bug.cgi?id=20900

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220570 91177308-0d34-0410-b5e6-96231b3b80d8
Remove DwarfDebug::FirstCU as it has no use

It was only being used as a flag to identify the lack of debug info from
within endModule - use the section labels for that instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220575 91177308-0d34-0410-b5e6-96231b3b80d8
remove class/function/variable names from comments; NFC


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220577 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Sink DwarfDebug::ScopeVariables down into DwarfFile

(part of refactoring to allow subprogram emission in both the skeleton
and main units to enable -gmlt-like data to be included in the skeleton
for live inlined backtracing purposes)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220578 91177308-0d34-0410-b5e6-96231b3b80d8
Allow AVX vrsqrtps generation.

This is a follow-on to r220570 that allows a 256-bit (v8f32)
version of vrsqrtps to be generated.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220579 91177308-0d34-0410-b5e6-96231b3b80d8
Don't ever call materializeAllPermanently during LTO.

To do this, change the representation of lazy loaded functions.

The previous representation cannot differentiate between a function whose body
has been removed and one whose body hasn't been read from the .bc file. That
means that in order to drop a function, the entire body had to be read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220580 91177308-0d34-0410-b5e6-96231b3b80d8
Fix copy paste comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220581 91177308-0d34-0410-b5e6-96231b3b80d8
[Hexagon] Resubmission of 220427
Modified library structure to deal with circular dependency between HexagonInstPrinter and HexagonMCInst.
Adding encoding bits for add opcode.
Adding llvm-mc tests.
Removing unit tests.

http://reviews.llvm.org/D5624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220584 91177308-0d34-0410-b5e6-96231b3b80d8
[X86][SSE] Bitcast assertion in XFormVExtractWithShuffleIntoLoad

Minor patch to fix an issue in XFormVExtractWithShuffleIntoLoad where a load is unary shuffled, then bitcast (to a type with the same number of elements) before extracting an element.

An undef was created for the second shuffle operand using the original (post-bitcasted) vector type instead of the pre-bitcasted type like the rest of the shuffle node - this was then causing an assertion on the different types later on inside SelectionDAG::getVectorShuffle.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220592 91177308-0d34-0410-b5e6-96231b3b80d8
Sink DwarfUnit::constructImportedEntityDIE into DwarfCompileUnit.

So that it has access to getOrCreateGlobalVariableDIE. If we ever support
decsribing using directive in C++ classes (thus requiring support in type
units), it will certainly use another mechanism anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220594 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a Mach-O assembler segfault for a subtraction expression with an undefined symbol.

In a Mach-O object file a relocatable expression of the form
SymbolA - SymbolB + constant is allowed when both symbols are
defined in a section.  But when either symbol is undefined it
is an error.

The code was crashing when it had an undefined symbol in this case.
And should have printed a error message using the location information
in the relocation entry.

rdar://18678402


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220599 91177308-0d34-0410-b5e6-96231b3b80d8
Modernize the error handling of the Materialize function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220600 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Make -msan-check-constant-shadow a bit stronger.

Allow (under the experimental flag) non-Instructions to participate in MSan checks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220601 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for the -suppress-warnings option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220603 91177308-0d34-0410-b5e6-96231b3b80d8
[NVPTX] aligned byte-buffers for vector return types

Summary:
Fixes PR21100 which is caused by inconsistency between the declared return type
and the expected return type at the call site. The new behavior is consistent
with nvcc and the NVPTXTargetLowering::getPrototype function.

Test Plan: test/Codegen/NVPTX/vector-return.ll

Reviewers: jholewinski

Reviewed By: jholewinski

Subscribers: llvm-commits, meheff, eliben, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220607 91177308-0d34-0410-b5e6-96231b3b80d8
Update the error handling of lib/Linker.

Instead of passing a std::string&, use the new diagnostic infrastructure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220610 91177308-0d34-0410-b5e6-96231b3b80d8
Allow the C API users to keep relying on the OutMessages parameter.

Should fix the Ocaml tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220611 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine: Remove overzealous asserts

These asserts can trigger if the worklist iteration order is
sufficiently unlucky.  Instead of adding special case logic to handle
these edge conditions, just bail out on trying to transform them:
InstSimplify will get them when it reaches them on the worklist.

This fixes PR21378.

N.B.  No test case is included because any test would rely on the
fragile worklist iteration order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220612 91177308-0d34-0410-b5e6-96231b3b80d8
[X86][SSE] Vector integer/float conversion memory folding

Tidied up some entries in the folding tables so that they are under the correct comment section (they were categorised as AVX2 instructions when they're AVX1).

Minor patch agreed with qcolombet.



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