Include an LLVM-vs2012_xp toolset in the MSBuild integration

Patch by Paul Hampson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191010 91177308-0d34-0410-b5e6-96231b3b80d8
  Add function DominatorTree::getDescendants(). 

  As its name suggests, this function will return all basic blocks
dominated by a given block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191014 91177308-0d34-0410-b5e6-96231b3b80d8
msbuild: Set _MSC_VER to match the CRT we're using

Various Windows SDK headers use _MSC_VER values to figure out what
version of the VC++ headers they're using, in particular for SAL macros.

Patch by Paul Hampson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191015 91177308-0d34-0410-b5e6-96231b3b80d8
GVN proceeds in the presence of dead code.

This is how it ignores the dead code:
1) When a dead branch target, say block B, is identified, all the
    blocks dominated by B is dead as well.

2) The PHIs of those blocks in dominance-frontier(B) is updated such
   that the operands corresponding to dead predecessors are replaced
   by "UndefVal".

   Using lattice's jargon, the "UndefVal" is the "Top" in essence.
   Phi node like this "phi(v1 bb1, undef xx)" will be optimized into
   "v1" if v1 is constant, or v1 is an instruction which dominate this
   PHI node.

3) When analyzing the availability of a load L, all dead mem-ops which
   L depends on disguise as a load which evaluate exactly same value as L.

4) The dead mem-ops will be materialized as "UndefVal" during code motion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191017 91177308-0d34-0410-b5e6-96231b3b80d8
Fix a typo and simplify a boolean expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191018 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unnecessary conditional operators performing bool->bool conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191020 91177308-0d34-0410-b5e6-96231b3b80d8
X86 horizontal vector reduction cost model

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191021 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Simplify gnu_pubnames index computation.

Names open to bikeshedding. Could switch back to the constants being
unshifted, but this way seems a bit easier to work with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191025 91177308-0d34-0410-b5e6-96231b3b80d8
Remove extraneous space, the asm printing infrastructure adds a space
in normally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191026 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-c: Make LLVMGetFirstTarget a proper prototype

This avoids warnings when included in a application that
uses -Wstrict-prototypes.

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



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

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191030 91177308-0d34-0410-b5e6-96231b3b80d8
Unshift the GDB index/GNU pubnames constants modified in r191025

Based on code review feedback from Eric Christopher, unshifting these
constants as they can appear in the gdb_index itself, shifted a further
24 bits. This means that keeping them preshifted is a bit inflexible, so
let's not do that.

Given the motivation, wrap up some nicer enums, more type safety, and
some utility functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191035 91177308-0d34-0410-b5e6-96231b3b80d8
InstCombine: Don't allow turning vector-of-pointer loads into vector-of-integer.

The code below can't handle any pointers. PR17293.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191036 91177308-0d34-0410-b5e6-96231b3b80d8
[Fast-math] Disable "(C1/X)*C2 => (C1*C2)/X" if C1/X has multiple uses.

  If "C1/X" were having multiple uses, the only benefit of this
transformation is to potentially shorten critical path. But it is at the
cost of instroducing additional div.

  The additional div may or may not incur cost depending on how div is
implemented. If it is implemented using Newton–Raphson iteration, it dosen't
seem to incur any cost (FIXME). However, if the div blocks the entire
pipeline, that sounds to be pretty expensive. Let CodeGen to take care 
this transformation.

  This patch sees 6% on a benchmark.

rdar://15032743


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191037 91177308-0d34-0410-b5e6-96231b3b80d8
Unbreak C++03 build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191039 91177308-0d34-0410-b5e6-96231b3b80d8
Add testcase to make sure we don't generate too many jumps for a une compare.
<rdar://problem/7859988>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191040 91177308-0d34-0410-b5e6-96231b3b80d8
Fix LTO handling of module-level assembly (PR14152).

Patch by Tom Roeder!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191042 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Improve IR annotation comments for GNU pubthings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191043 91177308-0d34-0410-b5e6-96231b3b80d8
PR16726: extend rol/ror matching

C-like languages promote types like unsigned short to unsigned int before
performing an arithmetic operation. Currently the rotate matcher in the
DAGCombiner does not consider this situation.

This commit extends the DAGCombiner in the way that the pattern

(or (shl ([az]ext x), (*ext y)), (srl ([az]ext x), (*ext (sub 32, y))))

is folded into

([az]ext (rotl x, y))

The matching is restricted to aext and zext because in this cases the upper
bits are either undefined or known. Test case is included.

This fixes PR16726.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191045 91177308-0d34-0410-b5e6-96231b3b80d8
Revert PR16726: extend rol/ror matching

There is a buildbot failure. Need to investigate this.

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