Try to open the file before use data from stat.

Looks like on mingw we get bogus last modification times on directories.
Should fix the mingw bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186240 91177308-0d34-0410-b5e6-96231b3b80d8
LoopVectorize fix: LoopInfo must be valid when invoking utils like SCEVExpander.

In general, one should always complete CFG modifications first, update
CFG-based analyses, like Dominatores and LoopInfo, then generate
instruction sequences.

LoopVectorizer was creating a new loop, calling SCEVExpander to
generate checks, then updating LoopInfo. I just changed the order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186241 91177308-0d34-0410-b5e6-96231b3b80d8
Make the new vectorizer test immune to TTI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186242 91177308-0d34-0410-b5e6-96231b3b80d8
Pass SmallVector by const reference instead of by value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186243 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unneeded forward declarations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186244 91177308-0d34-0410-b5e6-96231b3b80d8
Attempt at fixing a mingw bot.

It is failing with

YAMLTest.cpp:38:   instantiated from here
YAMLTraits.h:226: error: 'llvm::yaml::MappingTraits<<unnamed>::BinaryHolder>::mapping' is not a valid template argument for type 'void (*)(llvm::yaml::IO&, <unnamed>::BinaryHolder&)' because function 'static void llvm::yaml::MappingTraits<<unnamed>::BinaryHolder>::mapping(llvm::yaml::IO&, <unnamed>::BinaryHolder&)' has not external linkage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186245 91177308-0d34-0410-b5e6-96231b3b80d8
Only verify the length in archive test, we can't make assumptions on the spacing.

And .* did just match about anything anyways.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186246 91177308-0d34-0410-b5e6-96231b3b80d8
Convert a couple of grep tests to FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186250 91177308-0d34-0410-b5e6-96231b3b80d8
Reduce large list of macros to the primary platform macros. Distingiush
between ELF (Linux, FreeBSD, NetBSD) and OSX as platform for the
assembler dialect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186252 91177308-0d34-0410-b5e6-96231b3b80d8
LoopVectorizer: Disallow reductions whose header phi is used outside the loop

If an outside loop user of the reduction value uses the header phi node we
cannot just reduce the vectorized phi value in the vector code epilog because
we would loose VF-1 reductions.

lp:
  p = phi (0, lv)
  lv = lv + 1
  ...
  brcond , lp, outside

outside:
  usr = add 0, p

(Say the loop iterates two times, the value of p coming out of the loop is one).

We cannot just transform this to:

vlp:
  p = phi (<0,0>, lv)
  lv = lv + <1,1>
  ..
  brcond , lp, outside

outside:
  p_reduced = p[0] + [1];
  usr = add 0, p_reduced

(Because the original loop iterated two times the vectorized loop would iterate
one time, but p_reduced ends up being zero instead of one).

We would have to execute VF-1 iterations in the scalar remainder loop in such
cases. For now, just disable vectorization.

PR16522

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186256 91177308-0d34-0410-b5e6-96231b3b80d8
Convert CodeGen/*/*.ll tests to use the new CHECK-LABEL for easier debugging. No functionality change and all tests pass after conversion.

This was done with the following sed invocation to catch label lines demarking function boundaries:
    sed -i '' "s/^;\( *\)\([A-Z0-9_]*\):\( *\)test\([A-Za-z0-9_-]*\):\( *\)$/;\1\2-LABEL:\3test\4:\5/g" test/CodeGen/*/*.ll
which was written conservatively to avoid false positives rather than false negatives. I scanned through all the changes and everything looks correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186258 91177308-0d34-0410-b5e6-96231b3b80d8
Add newlines at end of test files, no functionality change


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186263 91177308-0d34-0410-b5e6-96231b3b80d8
Convert Windows to Unix line endings, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186264 91177308-0d34-0410-b5e6-96231b3b80d8
Modify two Transforms tests to explicitly check for full function names in some cases, rather than just a common prefix. No functionality change.

(This is to avoid confusing a scripted mass update of these tests to use CHECK-LABEL)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186267 91177308-0d34-0410-b5e6-96231b3b80d8
Update Transforms tests to use CHECK-LABEL for easier debugging. No functionality change.

This update was done with the following bash script:

  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186268 91177308-0d34-0410-b5e6-96231b3b80d8
Catch more CHECK that can be converted to CHECK-LABEL in Transforms for easier debugging. No functionality change.

This conversion was done with the following bash script:

  find test/Transforms -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    if ! grep -q "^; *RUN: *llc" $NAME; then
      TEMP=`mktemp -t temp`
      cp $NAME $TEMP
      sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
      while read FUNC; do
        sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)define\([^@]*\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3define\4@$FUNC(/g" $TEMP
      done
      mv $TEMP $NAME
    fi
  done


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186269 91177308-0d34-0410-b5e6-96231b3b80d8
Fixup to r186268 and r186269: don't append -LABEL to CHECK-NOT. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186271 91177308-0d34-0410-b5e6-96231b3b80d8
Teach indvars to generate nsw/nuw flags when widening an induction variable.

Fixes PR16600.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186272 91177308-0d34-0410-b5e6-96231b3b80d8
Remove a bunch of old SCEVExpander FIXME's for preserving NoWrap.

The great thing about the SCEVAddRec No-Wrap flag (unlike nsw/nuw) is
that is can be preserved while normalizing (reassociating and
factoring).

The bad thing is that is can't be tranfered back to IR, which is one
of the reasons I don't like the concept of SCEVExpander.

Sorry, I can't think of a direct way to test this, which is why these
were FIXMEs for so long. I just think it's a good time to finally
clean it up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186273 91177308-0d34-0410-b5e6-96231b3b80d8
Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

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