[BUG][INDVAR] Fix for PR21014: wrong SCEV operands commuting for non-commutative instructions

My commit rL216160 introduced a bug PR21014: IndVars widens code 'for (i = ; i < ...; i++) arr[ CONST - i]' into 'for (i = ; i < ...; i++) arr[ i - CONST]'
thus inverting index expression. This patch fixes it. 
Thanks to Jörg Sonnenberger for pointing.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218867 91177308-0d34-0410-b5e6-96231b3b80d8
Silence a -Wsign-compare warning. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218868 91177308-0d34-0410-b5e6-96231b3b80d8
Support padding unaligned data in .text.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218870 91177308-0d34-0410-b5e6-96231b3b80d8
[NVPTX] Remove dead code.

Found by the Clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218874 91177308-0d34-0410-b5e6-96231b3b80d8
Remove duplicate function names from comments. NFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218875 91177308-0d34-0410-b5e6-96231b3b80d8
Use the local variable that other clauses around here are already using.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218876 91177308-0d34-0410-b5e6-96231b3b80d8
InstrProf: Don't keep a large sparse list around just to zero it

The Terms vector here represented a polynomial of of all possible
counters, and is used to simplify expressions when generating coverage
mapping. There are a few problems with this:

1. Keeping the vector as a member is wasteful, since we clear it every
   time we use it.
2. Most expressions refer to a subset of the counters, so we end up
   iterating over a large number of zeros doing nothing a lot of the
   time.

This updates the user of the vector to store the terms locally, and
uses a sort and combine approach so that we only operate on counters
that are actually used in a given expression. For small cases this
makes very little difference, but in cases with a very large number of
counted regions this is a significant performance fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218879 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "InstrProf: Don't keep a large sparse list around just to zero it"

This seems to be crashing on some buildbots. Reverting to investigate.

This reverts commit r218879.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218881 91177308-0d34-0410-b5e6-96231b3b80d8
Merge branch 'master', remote-tracking branch 'trunk/master'