InstCombine: mul to shl shouldn't preserve nsw

consider:
mul i32 nsw %x, -2147483648

this instruction will not result in poison if %x is 1

however, if we transform this into:
shl i32 nsw %x, 31

then we will be generating poison because we just shifted into the sign
bit.

This fixes PR21242.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219566 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine, InstSimplify: (%X /s C1) /s C2 isn't always 0 when C1 * C2 overflow

consider:
C1 = INT_MIN
C2 = -1

C1 * C2 overflows without a doubt but consider the following:
%x = i32 INT_MIN

This means that (%X /s C1) is 1 and (%X /s C1) /s C2 is -1.

N. B.  Move the unsigned version of this transform to InstSimplify, it
doesn't create any new instructions.

This fixes PR21243.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219567 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine: Don't fold (X <<s log(INT_MIN)) /s INT_MIN to X

Consider the case where X is 2.  (2 <<s 31)/s-2147483648 is zero but we
would fold to X.  Note that this is valid when we are in the unsigned
domain because we require NUW: 2 <<u 31 results in poison.

This fixes PR21245.

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

Fix comment typo + spelling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219572 91177308-0d34-0410-b5e6-96231b3b80d8
MC: Bit pack MCSymbolData.

On x86_64 this brings it from 80 bytes to 64 bytes. Also make any member
variables private and clean up uses to go through the existing accessors.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219573 91177308-0d34-0410-b5e6-96231b3b80d8
MC: Shrink MCSymbolRefExpr by only storing the bits we need.

32 -> 16 bytes on x86_64. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219574 91177308-0d34-0410-b5e6-96231b3b80d8
AssumptionTracker: Don't create temporary CallbackVHs.

Those are expensive to create in cold cache scenarios. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219575 91177308-0d34-0410-b5e6-96231b3b80d8
Test commit access (email fix)

Indentation tidyup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219577 91177308-0d34-0410-b5e6-96231b3b80d8
Suppress llvm-ar's MRI tests for now on win32, since line_iterator is incompatible to CRLF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219579 91177308-0d34-0410-b5e6-96231b3b80d8
llvm/test/CodeGen: Some tests don't REQUIRE asserts any more. Remove them.

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

A helper routine, MultiplyOverflows, was a less efficient
reimplementation of APInt's smul_ov and umul_ov.  While we are here,
clean up the code so it's more uniform.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219583 91177308-0d34-0410-b5e6-96231b3b80d8
[X86] Memory folding for commutative instructions.

This patch improves support for commutative instructions in the x86 memory folding implementation by attempting to fold a commuted version of the instruction if the original folding fails - if that folding fails as well the instruction is 're-commuted' back to its original order before returning.

This mainly helps the stack inliner better fold reloads of 3 (or more) operand instructions (VEX encoded SSE etc.) but by performing this in the lowest foldMemoryOperandImpl implementation it also replaces the X86InstrInfo::optimizeLoadInstr version and is now used by FastISel too.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219584 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine: Turn (x != 0 & x <u C) into the canonical range check form (x-1 <u C-1)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219585 91177308-0d34-0410-b5e6-96231b3b80d8
APSInt: Simplify code to reduce the number of copies. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219586 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r219223, it creates invalid PHI nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219587 91177308-0d34-0410-b5e6-96231b3b80d8
Modernize old-style static asserts. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219588 91177308-0d34-0410-b5e6-96231b3b80d8
[Modules] Add some missing includes to make files compile stand-alone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219592 91177308-0d34-0410-b5e6-96231b3b80d8
[modules] Stop excluding Support/Debug.h from the Support module. This header
has been modular since r206822, and excluding it was leading to workarounds
such as the one in r219592, which this change removes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219593 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r219584, "[X86] Memory folding for commutative instructions."

It broke i686 selfhosting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219595 91177308-0d34-0410-b5e6-96231b3b80d8
Unix/Signals.inc: Let findModulesAndOffsets() built conditionally regarding to (defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)). [-Wunused-function]

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