PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad OR-result.

Mark conversion operator explicit and const qualify comparison operators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211244 91177308-0d34-0410-b5e6-96231b3b80d8
Fix breakage from r211244 by using LLVM_EXPLICIT to avoid using explicit operators under MSVC where they're not supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211246 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Add intrinsics for various math instructions.

These will be used for custom lowering and for library
implementations of various math functions, so it's useful
to expose these as builtins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211247 91177308-0d34-0410-b5e6-96231b3b80d8
MS asm: Properly handle quoted symbol names

We would get confused by '@' characters in symbol names, we would
mistake the text following them for the variant kind.

When an identifier a string, the variant kind will never show up inside
of it.  Instead, check to see if there is a variant following the
string.

This fixes PR19965.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211249 91177308-0d34-0410-b5e6-96231b3b80d8
Remove redundant code in InstCombineShift, no functionality change because instsimplify already does this and instcombine calls instsimplify a few lines above. Patch by Suyog Sarda!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211250 91177308-0d34-0410-b5e6-96231b3b80d8
Make instsimplify's analysis of icmp eq/ne use computeKnownBits to determine whether the icmp is always true or false. Patch by Suyog Sarda!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211251 91177308-0d34-0410-b5e6-96231b3b80d8
Move optimization of some cases of (A & C1)|(B & C2) from instcombine to instsimplify. Patch by Rahul Jain, plus some last minute changes by me -- you can blame me for any bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211252 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Add a few tests I forgot to add.

These belong with r210827

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211253 91177308-0d34-0410-b5e6-96231b3b80d8
Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211256 91177308-0d34-0410-b5e6-96231b3b80d8
Move -dwarf-version to an MC level command line option so it's
used by all of the MC level tools and codegen. Fix up all uses
in the compiler to use this and set it on the context accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211257 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine: Stop two transforms dueling

InstCombineMulDivRem has:
// Canonicalize (X+C1)*CI -> X*CI+C1*CI.

InstCombineAddSub has:
// W*X + Y*Z --> W * (X+Z)  iff W == Y

These two transforms could fight with each other if C1*CI would not fold
away to something simpler than a ConstantExpr mul.

The InstCombineMulDivRem transform only acted on ConstantInts until
r199602 when it was changed to operate on all Constants in order to
let it fire on ConstantVectors.

To fix this, make this transform more careful by checking to see if we
actually folded away C1*CI.

This fixes PR20079.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211258 91177308-0d34-0410-b5e6-96231b3b80d8
Remove OwningPtr.h and associated tests

llvm::OwningPtr is superseded by std::unique_ptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211259 91177308-0d34-0410-b5e6-96231b3b80d8
CommandLine: bail out when options get multiply registered

These errors are strictly unrecoverable and indicate serious issues such as
conflicting option names or an incorrectly linked LLVM distribution.

With this change, the errors actually get detected so tests don't pass
silently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211260 91177308-0d34-0410-b5e6-96231b3b80d8
Refactored and updated SimplifyUsingDistributiveLaws() to 
 * Find factorization opportunities using identity values.
 * Find factorization opportunities by treating shl(X, C) as mul (X, shl(C))
 * Keep NSW flag while simplifying instruction using factorization.

This fixes PR19263.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211261 91177308-0d34-0410-b5e6-96231b3b80d8
[X86] Teach how to combine horizontal binop even in the presence of undefs.

Before this change, the backend was unable to fold a build_vector dag
node with UNDEF operands into a single horizontal add/sub.

This patch teaches how to combine a build_vector with UNDEF operands into a
horizontal add/sub when possible. The algorithm conservatively avoids to combine
a build_vector with only a single non-UNDEF operand.

Added test haddsub-undef.ll to verify that we correctly fold horizontal binop
even in the presence of UNDEFs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211265 91177308-0d34-0410-b5e6-96231b3b80d8
Added instruction combine to transform few more negative values addition to subtraction (Part 1)
This patch enables transforms for following patterns.
  (x + (~(y & c) + 1)   -->   x - (y & c)
  (x + (~((y >> z) & c) + 1)   -->   x - ((y>>z) & c)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211266 91177308-0d34-0410-b5e6-96231b3b80d8
Updated comments as suggested by Rafael. Thanks.



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