Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):

  PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Note: because this is applied on top of llvm/clang 3.5.0, this fix is
slightly different from the one just checked into head in r275633.
Merge ^/head r275623 through 275634.