Refactor operation equivalence checking in BBVectorize by extending Instruction::isSameOperationAs.

Maintaining this kind of checking in different places is dangerous, extending
Instruction::isSameOperationAs consolidates this logic into one place. Here
I've added an optional flags parameter and two flags that are important for
vectorization: CompareIgnoringAlignment and CompareUsingScalarTypes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159329 91177308-0d34-0410-b5e6-96231b3b80d8
Allow BBVectorize to form non-2^n-length vectors.

The original algorithm only used recursive pair fusion of equal-length
types. This is now extended to allow pairing of any types that share
the same underlying scalar type. Because we would still generally
prefer the 2^n-length types, those are formed first. Then a second
set of iterations form the non-2^n-length types.

Also, a call to SimplifyInstructionsInBlock has been added after each
pairing iteration. This takes care of DCE (and a few other things)
that make the following iterations execute somewhat faster. For the
same reason, some of the simple shuffle-combination cases are now
handled internally.

There is some additional refactoring work to be done, but I've had
many requests for this feature, so additional refactoring will come
soon in future commits (as will additional test cases).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159330 91177308-0d34-0410-b5e6-96231b3b80d8
Remove a useless check in BBVectorize.

A shuffle mask will always be a constant, but I did not realize that
when I originally wrote the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159331 91177308-0d34-0410-b5e6-96231b3b80d8
Precompute SCEV pointer analysis prior to instruction fusion in BBVectorize.

When both a load/store and its address computation are being vectorized, it can
happen that the address-computation vectorization destroys SCEV's ability
to analyize the relative pointer offsets. As a result (like with the aliasing
analysis info), we need to precompute the necessary information prior to
instruction fusing.

This was found during stress testing (running through the test suite with a very
low required chain length); unfortunately, I don't have a small test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159332 91177308-0d34-0410-b5e6-96231b3b80d8
Move the setup for variables that are expanded in the lit.site.cfg into
a dedicated helper function. This will enable re-using the same logic
for Clang's lit setup, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159333 91177308-0d34-0410-b5e6-96231b3b80d8
Fix Windows build after r159281: s/iterator/const_iterator

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159334 91177308-0d34-0410-b5e6-96231b3b80d8
Sphinxify the bitcode format document.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159340 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] set a hard limit on the number of instructions instrumented pear each BB. This is (hopefully temporary) workaround for PR13225 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159344 91177308-0d34-0410-b5e6-96231b3b80d8
Devirtualize DIScope and subclasses.

Nothing in here makes use of the virtuality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159349 91177308-0d34-0410-b5e6-96231b3b80d8
add ConstantRange::difference (to perform set difference/relative complement)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159352 91177308-0d34-0410-b5e6-96231b3b80d8
make LazyValueInfo analyze the default case of switch statements (we know that in the default branch the value cannot be any of the switch cases)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159353 91177308-0d34-0410-b5e6-96231b3b80d8
MemoryBuiltins:
 - recognize C++ new(std::nothrow) friends
 - ignore ExtractElement and ExtractValue instructions in size/offset analysis (all easy cases are probably folded away before we get here)
 - also recognize realloc as noalias

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159356 91177308-0d34-0410-b5e6-96231b3b80d8
Define MIPS DSP Rev1 intrinsics. That allows frontend to emit a correct IR.
This patch was reviewed in the llvm-commits list by Jim Grosbach.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159364 91177308-0d34-0410-b5e6-96231b3b80d8
Enable automatic GCC<->LLVM intrinsic translation for mips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159367 91177308-0d34-0410-b5e6-96231b3b80d8
Fix hexagon gcc builtin names to use '_' instead of '.'.

This way the generated GCC builtin to LLVM intrinsic converter
actually works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159370 91177308-0d34-0410-b5e6-96231b3b80d8
Remove layering violation #include.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159374 91177308-0d34-0410-b5e6-96231b3b80d8
Changed the formatting sequence of a curly brace to 
the comment per code review feedback.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159376 91177308-0d34-0410-b5e6-96231b3b80d8
'Promote' vector [su]int_to_fp should widen elements.

Teach vector legalization how to honor Promote for int to float
conversions. The code checking whether to promote the operation knew
to look at the operand, but the actual promotion code didn't. This
fixes that. The operand is promoted up via [zs]ext.

rdar://11762659

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159378 91177308-0d34-0410-b5e6-96231b3b80d8
add a new @llvm.donothing intrinsic that, well, does nothing, and teach CodeGen to ignore calls to it

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