Index: include/clang/AST/Stmt.h
===================================================================
--- include/clang/AST/Stmt.h	(revision 206930)
+++ include/clang/AST/Stmt.h	(working copy)
@@ -20,6 +20,8 @@
 #include "clang/Basic/IdentifierTable.h"
 #include "clang/Basic/LLVM.h"
 #include "clang/Basic/SourceLocation.h"
+#include "clang/Basic/LoopHint.h"
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/Support/Compiler.h"
@@ -1015,13 +1017,41 @@
   }
 };
 
+/// LoopHints - This provides the interface
+/// for specifying and retrieving vectorize and interleave hints
+///
+class LoopHints {
+  SmallVector<LoopHint, 1> CondBrLoopHints;
 
+public:
+  /// Add a loop hint to the conditional branch of the loop
+  void addCondBrLoopHint(LoopHint Hint) {
+    CondBrLoopHints.push_back(Hint);
+  }
+
+  /// Returns true if loop hints have been specified
+  bool hasCondBrLoopHints() const {
+    return !CondBrLoopHints.empty();
+  }
+
+  /// Beginning of list of loop hints
+  SmallVectorImpl<LoopHint>::const_iterator beginCondBrLoopHints() const {
+    return CondBrLoopHints.begin();
+  }
+
+  /// Terminator of loop hints list
+  SmallVectorImpl<LoopHint>::const_iterator endCondBrLoopHints() const {
+    return CondBrLoopHints.end();
+  }
+};
+
 /// WhileStmt - This represents a 'while' stmt.
 ///
-class WhileStmt : public Stmt {
+class WhileStmt : public Stmt, public LoopHints {
   enum { VAR, COND, BODY, END_EXPR };
   Stmt* SubExprs[END_EXPR];
   SourceLocation WhileLoc;
+
 public:
   WhileStmt(const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body,
             SourceLocation WL);
@@ -1030,6 +1060,7 @@
   explicit WhileStmt(EmptyShell Empty) : Stmt(WhileStmtClass, Empty) { }
 
   /// \brief Retrieve the variable declared in this "while" statement, if any.
+
   ///
   /// In the following example, "x" is the condition variable.
   /// \code
@@ -1073,7 +1104,7 @@
 
 /// DoStmt - This represents a 'do/while' stmt.
 ///
-class DoStmt : public Stmt {
+class DoStmt : public Stmt, public LoopHints {
   enum { BODY, COND, END_EXPR };
   Stmt* SubExprs[END_EXPR];
   SourceLocation DoLoc;
@@ -1124,7 +1155,7 @@
 /// the init/cond/inc parts of the ForStmt will be null if they were not
 /// specified in the source.
 ///
-class ForStmt : public Stmt {
+class ForStmt : public Stmt, public LoopHints {
   enum { INIT, CONDVAR, COND, INC, BODY, END_EXPR };
   Stmt* SubExprs[END_EXPR]; // SubExprs[INIT] is an expression or declstmt.
   SourceLocation ForLoc;
Index: include/clang/Basic/LoopHint.h
===================================================================
--- include/clang/Basic/LoopHint.h	(revision 0)
+++ include/clang/Basic/LoopHint.h	(working copy)
@@ -0,0 +1,36 @@
+//===--- LoopHint.h - Types for LoopHint ------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef LLVM_CLANG_BASIC_LOOPHINT_H
+#define LLVM_CLANG_BASIC_LOOPHINT_H
+
+namespace clang {
+
+enum LoopHintKind {
+  LH_UNKNOWN    = 0x00,
+  LH_VECTORIZE  = 0x01,
+  LH_INTERLEAVE = 0x02,
+
+  LH_ENABLE     = 0x10,
+  LH_DISABLE    = 0x20,
+  LH_VALUE      = 0x40
+};
+
+/// \brief Loop hint specified by a pragma loop directive
+///  and used by codegen to attach metadata to the IR
+struct LoopHint {
+  int Kind;
+  uint64_t Value;
+};
+
+
+} // end namespace clang
+
+#endif // LLVM_CLANG_BASIC_LOOPHINT_H
Index: include/clang/Basic/TokenKinds.def
===================================================================
--- include/clang/Basic/TokenKinds.def	(revision 206930)
+++ include/clang/Basic/TokenKinds.def	(working copy)
@@ -701,6 +701,11 @@
 ANNOTATION(pragma_openmp)
 ANNOTATION(pragma_openmp_end)
 
+// Annotations for loop pragma directives #pragma loop ...
+// The lexer produces these so that they only take effect when the parser
+// handles #pragma loop ... directives.
+ANNOTATION(pragma_loop_hint)
+
 // Annotations for module import translated from #include etc.
 ANNOTATION(module_include)
 ANNOTATION(module_begin)
Index: include/clang/Parse/Parser.h
===================================================================
--- include/clang/Parse/Parser.h	(revision 206930)
+++ include/clang/Parse/Parser.h	(working copy)
@@ -17,6 +17,7 @@
 #include "clang/Basic/OpenMPKinds.h"
 #include "clang/Basic/OperatorPrecedence.h"
 #include "clang/Basic/Specifiers.h"
+#include "clang/Basic/LoopHint.h"
 #include "clang/Lex/CodeCompletionHandler.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Sema/DeclSpec.h"
@@ -160,6 +161,7 @@
   std::unique_ptr<PragmaHandler> MSConstSeg;
   std::unique_ptr<PragmaHandler> MSCodeSeg;
   std::unique_ptr<PragmaHandler> MSSection;
+  std::unique_ptr<PragmaHandler> LoopHintHandler;
 
   std::unique_ptr<CommentHandler> CommentSemaHandler;
 
@@ -517,6 +519,10 @@
   /// #pragma clang __debug captured
   StmtResult HandlePragmaCaptured();
 
+  /// \brief Handle the annotation token produced for
+  /// #pragma vectorize...
+  LoopHint HandlePragmaLoopHint();
+
   /// GetLookAheadToken - This peeks ahead N tokens and returns that token
   /// without consuming any tokens.  LookAhead(0) returns 'Tok', LookAhead(1)
   /// returns the token after Tok, etc.
@@ -1598,6 +1604,7 @@
   StmtResult ParseReturnStatement();
   StmtResult ParseAsmStatement(bool &msAsm);
   StmtResult ParseMicrosoftAsmStatement(SourceLocation AsmLoc);
+  StmtResult ParsePragmaLoopHint();
 
   /// \brief Describes the behavior that should be taken for an __if_exists
   /// block.
Index: lib/CodeGen/CGStmt.cpp
===================================================================
--- lib/CodeGen/CGStmt.cpp	(revision 206930)
+++ lib/CodeGen/CGStmt.cpp	(working copy)
@@ -18,6 +18,7 @@
 #include "clang/AST/StmtVisitor.h"
 #include "clang/Basic/PrettyStackTrace.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Basic/LoopHint.h"
 #include "clang/Sema/SemaDiagnostic.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/IR/CallSite.h"
@@ -500,6 +501,67 @@
   EmitBlock(ContBlock, true);
 }
 
+llvm::MDNode *CodeGenFunction::getLoopHints(llvm::LLVMContext &Context,
+                                            LoopHintIterator Begin,
+                                            LoopHintIterator End) {
+  llvm::IntegerType *BoolTy = llvm::Type::getInt1Ty(Context);
+  llvm::IntegerType *IntTy = llvm::Type::getInt32Ty(Context);
+
+  // If there are any vectorize hints on this loop
+  // add them as metadata on the conditional branch
+  SmallVectorImpl<LoopHint>::const_iterator I;
+  SmallVector<llvm::Value*, 2> Metadata(1);
+
+  for (I = Begin; I != End; ++I) {
+    // Replace name with MDString
+    SmallVector<llvm::Value*, 2> OpValues;
+
+    llvm::MDString *Name;
+    llvm::Value *Value;
+
+    switch(I->Kind) {
+    case LH_VECTORIZE|LH_ENABLE:
+      Name = llvm::MDString::get(Context, "llvm.vectorizer.enable");
+      Value = llvm::ConstantInt::get(BoolTy, true);
+      break;
+    case LH_VECTORIZE|LH_DISABLE:
+      Name = llvm::MDString::get(Context, "llvm.vectorizer.width");
+      Value = llvm::ConstantInt::get(IntTy, 1);
+      break;
+    case LH_VECTORIZE|LH_VALUE:
+      Name = llvm::MDString::get(Context, "llvm.vectorizer.width");
+      Value = llvm::ConstantInt::get(IntTy, I->Value);
+      break;
+    case LH_INTERLEAVE|LH_ENABLE:
+      Name = llvm::MDString::get(Context, "llvm.vectorizer.enable");
+      Value = llvm::ConstantInt::get(BoolTy, true);
+      break;
+    case LH_INTERLEAVE|LH_DISABLE:
+      Name = llvm::MDString::get(Context, "llvm.vectorizer.unroll");
+      Value = llvm::ConstantInt::get(IntTy, 1);
+      break;
+    case LH_INTERLEAVE|LH_VALUE:
+      Name = llvm::MDString::get(Context, "llvm.vectorizer.unroll");
+      Value = llvm::ConstantInt::get(IntTy, I->Value);
+      break;
+    default:
+      continue;
+    }
+
+    OpValues.push_back(Name);
+    OpValues.push_back(Value);
+
+    // Set or overwrite metadata indicated by Name
+    Metadata.push_back(llvm::MDNode::get(Context, OpValues));
+  }
+
+  // Add llvm.loop MDNode to CondBr
+  llvm::MDNode *LoopID = llvm::MDNode::get(Context, Metadata);
+  LoopID->replaceOperandWith(0, LoopID); //First op points to itself
+
+  return LoopID;
+}
+
 void CodeGenFunction::EmitWhileStmt(const WhileStmt &S) {
   RegionCounter Cnt = getPGORegionCounter(&S);
 
@@ -545,13 +607,24 @@
     llvm::BasicBlock *ExitBlock = LoopExit.getBlock();
     if (ConditionScope.requiresCleanups())
       ExitBlock = createBasicBlock("while.exit");
-    Builder.CreateCondBr(BoolCondVal, LoopBody, ExitBlock,
-                         PGO.createLoopWeights(S.getCond(), Cnt));
+    llvm::BranchInst *CondBr = Builder.CreateCondBr(
+                               BoolCondVal, LoopBody, ExitBlock,
+                               PGO.createLoopWeights(S.getCond(), Cnt));
 
     if (ExitBlock != LoopExit.getBlock()) {
       EmitBlock(ExitBlock);
       EmitBranchThroughCleanup(LoopExit);
     }
+
+    // Attach metadata to loop body conditional branch
+    if (S.hasCondBrLoopHints())
+    {
+      llvm::MDNode *LoopID = getLoopHints(LoopBody->getContext(),
+                                          S.beginCondBrLoopHints(),
+                                          S.endCondBrLoopHints());
+
+      CondBr->setMetadata("llvm.loop", LoopID);
+    }
   }
 
   // Emit the loop body.  We have to emit this in a cleanup scope
@@ -617,10 +690,22 @@
       EmitBoolCondBranch = false;
 
   // As long as the condition is true, iterate the loop.
-  if (EmitBoolCondBranch)
-    Builder.CreateCondBr(BoolCondVal, LoopBody, LoopExit.getBlock(),
-                         PGO.createLoopWeights(S.getCond(), Cnt));
+  if (EmitBoolCondBranch) {
+    llvm::BranchInst *CondBr = Builder.CreateCondBr(
+                                 BoolCondVal, LoopBody, LoopExit.getBlock(),
+                                 PGO.createLoopWeights(S.getCond(), Cnt));
 
+    // Attach metadata to loop body conditional branch
+    if (S.hasCondBrLoopHints())
+    {
+      llvm::MDNode *LoopID = getLoopHints(LoopBody->getContext(),
+                                               S.beginCondBrLoopHints(),
+                                               S.endCondBrLoopHints());
+
+      CondBr->setMetadata("llvm.loop", LoopID);
+    }
+  }
+
   // Emit the exit block.
   EmitBlock(LoopExit.getBlock());
 
@@ -684,9 +769,20 @@
     // C99 6.8.5p2/p4: The first substatement is executed if the expression
     // compares unequal to 0.  The condition must be a scalar type.
     llvm::Value *BoolCondVal = EvaluateExprAsBool(S.getCond());
-    Builder.CreateCondBr(BoolCondVal, ForBody, ExitBlock,
-                         PGO.createLoopWeights(S.getCond(), Cnt));
+    llvm::BranchInst *CondBr = Builder.CreateCondBr(
+                                 BoolCondVal, ForBody, ExitBlock,
+                                 PGO.createLoopWeights(S.getCond(), Cnt));
 
+    // Attach metadata to loop body conditional branch
+    if (S.hasCondBrLoopHints())
+    {
+      llvm::MDNode *LoopID = getLoopHints(ForBody->getContext(),
+                                          S.beginCondBrLoopHints(),
+                                          S.endCondBrLoopHints());
+
+      CondBr->setMetadata("llvm.loop", LoopID);
+    }
+
     if (ExitBlock != LoopExit.getBlock()) {
       EmitBlock(ExitBlock);
       EmitBranchThroughCleanup(LoopExit);
Index: lib/CodeGen/CodeGenFunction.h
===================================================================
--- lib/CodeGen/CodeGenFunction.h	(revision 206930)
+++ lib/CodeGen/CodeGenFunction.h	(working copy)
@@ -2518,6 +2518,10 @@
   void SetFPAccuracy(llvm::Value *Val, float Accuracy);
 
 private:
+  typedef SmallVectorImpl<LoopHint>::const_iterator LoopHintIterator;
+  llvm::MDNode *getLoopHints(llvm::LLVMContext &Context,
+                             LoopHintIterator Begin,
+                             LoopHintIterator End);
   llvm::MDNode *getRangeForLoadFromType(QualType Ty);
   void EmitReturnOfRValue(RValue RV, QualType Ty);
 
Index: lib/Parse/ParsePragma.cpp
===================================================================
--- lib/Parse/ParsePragma.cpp	(revision 206930)
+++ lib/Parse/ParsePragma.cpp	(working copy)
@@ -16,6 +16,7 @@
 #include "clang/Parse/ParseDiagnostic.h"
 #include "clang/Parse/Parser.h"
 #include "clang/Sema/Scope.h"
+#include "clang/Basic/LoopHint.h"
 #include "llvm/ADT/StringSwitch.h"
 using namespace clang;
 
@@ -131,6 +132,12 @@
                     Token &FirstToken) override;
 };
 
+struct PragmaLoopHintHandler : public PragmaHandler {
+  PragmaLoopHintHandler() : PragmaHandler("loop") {}
+  void HandlePragma(Preprocessor &PP, PragmaIntroducerKind Introducer,
+                    Token &FirstToken) override;
+};
+
 }  // end namespace
 
 void Parser::initializePragmaHandlers() {
@@ -195,6 +202,9 @@
     MSSection.reset(new PragmaMSPragma("section"));
     PP.AddPragmaHandler(MSSection.get());
   }
+
+  LoopHintHandler.reset(new PragmaLoopHintHandler());
+  PP.AddPragmaHandler(LoopHintHandler.get());
 }
 
 void Parser::resetPragmaHandlers() {
@@ -249,6 +259,10 @@
 
   PP.RemovePragmaHandler("STDC", FPContractHandler.get());
   FPContractHandler.reset();
+
+  PP.RemovePragmaHandler(LoopHintHandler.get());
+  LoopHintHandler.reset();
+
 }
 
 /// \brief Handle the annotation token produced for #pragma unused(...)
@@ -570,6 +584,14 @@
       DiagnosticsEngine::Error, "'#pragma %0' not implemented.");
 }
 
+LoopHint Parser::HandlePragmaLoopHint() {
+  assert(Tok.is(tok::annot_pragma_loop_hint));
+  LoopHint Hint =
+    *static_cast<LoopHint *>(Tok.getAnnotationValue());
+
+  return Hint;
+}
+
 // #pragma GCC visibility comes in two variants:
 //   'push' '(' [visibility] ')'
 //   'pop'
@@ -1531,3 +1553,116 @@
 
   Actions.ActOnPragmaMSComment(Kind, ArgumentString);
 }
+
+/// \brief Handle the \#pragma vectorize hint
+///
+/// The syntax is:
+/// \code
+///   #pragma loop vectorize(enable/disable/_value_)
+///   #pragma loop interleave(enable/disable/_value_)
+///   #pragma loop vectorize(...) interleave(...) ...
+/// \endcode
+/// Specifying vectorize(enable) or vectorize(_value_) instructs llvm to
+/// try vectorizing the subsequent loop. Specifying interleave(enable) or
+/// interleave(_value_) instructs llvm to tru interleaving the subsequent loop
+/// Giving a _value_ of 1 or "disable" prevents the optimization, even if it
+/// is possible or profitable. The loop vectorizer currently only works on
+/// inner loops.
+void PragmaLoopHintHandler::HandlePragma(Preprocessor &PP,
+                                         PragmaIntroducerKind Introducer,
+                                         Token &Tok) {
+  SourceLocation LoopHintLoc = Tok.getLocation();
+
+  SmallVector <Token, 1> TokenList;
+
+  // Read the hint identifier
+  PP.Lex(Tok);
+  if (Tok.isNot(tok::identifier)) {
+    PP.Diag(Tok.getLocation(), diag::err_expected) <<
+      "vectorize, or interleave";
+    return;
+  }
+
+  while(Tok.is(tok::identifier)) {
+
+    // Verify that it is vectorize or interleave
+    IdentifierInfo *II = Tok.getIdentifierInfo();
+    int Kind = llvm::StringSwitch<LoopHintKind>(II->getName())
+      .Case("vectorize", LH_VECTORIZE)
+      .Case("interleave", LH_INTERLEAVE)
+      .Default(LH_UNKNOWN);
+
+    if (Kind == LH_UNKNOWN) {
+      PP.Diag(Tok.getLocation(), diag::err_expected) <<
+      "vectorize, or interleave";
+      return;
+    }
+
+    // Read '('
+    PP.Lex(Tok);
+    if (Tok.isNot(tok::l_paren)) {
+      PP.Diag(Tok.getLocation(), diag::err_expected) << tok::l_paren;
+      return;
+    }
+
+    // Read optimization option identifier
+    PP.Lex(Tok);
+    LoopHint *Hint =
+      (LoopHint*) PP.getPreprocessorAllocator().Allocate(
+        sizeof(LoopHint), llvm::alignOf<LoopHint>());
+
+    int Option = LH_UNKNOWN;
+    if (Tok.is(tok::identifier)) {
+      // Verify that this is either enable or disable
+      II = Tok.getIdentifierInfo();
+      Option = llvm::StringSwitch<LoopHintKind>(II->getName())
+        .Case("enable",  LH_ENABLE)
+        .Case("disable", LH_DISABLE)
+        .Default(LH_UNKNOWN);
+      PP.Lex(Tok);
+    }
+    else if (Tok.is(tok::numeric_constant) &&
+             PP.parseSimpleIntegerLiteral(Tok, Hint->Value) &&
+             Hint->Value >= 1) {
+      // Next token is lexed by parseSimpleIntegerLiteral
+      Option = LH_VALUE;
+    }
+
+    if (Option == LH_UNKNOWN) {
+      PP.Diag(Tok.getLocation(), diag::err_expected) <<
+      "enable, disable, or a positive integer";
+      return;
+    }
+
+    Hint->Kind = Kind | Option;
+
+    // Read ')'
+    if (Tok.isNot(tok::r_paren)) {
+      PP.Diag(Tok.getLocation(), diag::err_expected) << tok::r_paren;
+      return;
+    }
+
+    // Get next token
+    PP.Lex(Tok);
+
+    // Vectorization Hint Token
+    Token LoopHintTok;
+    LoopHintTok.startToken();
+    LoopHintTok.setKind(tok::annot_pragma_loop_hint);
+    LoopHintTok.setLocation(LoopHintLoc);
+    LoopHintTok.setAnnotationValue(static_cast<void*>(Hint));
+    TokenList.push_back(LoopHintTok);
+  }
+
+  if (Tok.isNot(tok::eod)) {
+    PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
+      "loop";
+    return;
+  }
+
+  // Push loop hint tokens for stmt parsing
+  while (!TokenList.empty()) {
+    PP.EnterToken(TokenList.back());
+    TokenList.pop_back();
+  }
+}
Index: lib/Parse/ParseStmt.cpp
===================================================================
--- lib/Parse/ParseStmt.cpp	(revision 206930)
+++ lib/Parse/ParseStmt.cpp	(working copy)
@@ -19,6 +19,7 @@
 #include "clang/Basic/PrettyStackTrace.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Basic/LoopHint.h"
 #include "clang/Sema/DeclSpec.h"
 #include "clang/Sema/PrettyDeclStackTrace.h"
 #include "clang/Sema/Scope.h"
@@ -354,6 +355,10 @@
     ProhibitAttributes(Attrs);
     HandlePragmaMSPragma();
     return StmtEmpty();
+
+  case tok::annot_pragma_loop_hint:
+    ProhibitAttributes(Attrs);
+    return ParsePragmaLoopHint();
   }
 
   // If we reached this code, the statement must end in a semicolon.
@@ -1750,6 +1755,45 @@
   return Actions.ActOnReturnStmt(ReturnLoc, R.take());
 }
 
+StmtResult Parser::ParsePragmaLoopHint()
+{
+  // Get vectorize hint and consume annotated token
+  LoopHint Hint = HandlePragmaLoopHint();
+  SourceLocation PragmaLoc = ConsumeToken();
+
+  // Get next statement
+  if (Tok.is(tok::annot_pragma_loop_hint) ||
+      Tok.is(tok::kw_while) || Tok.is(tok::kw_do) || Tok.is(tok::kw_for)) {
+    StmtResult NextStmt = ParseStatement();
+
+    if (!NextStmt.isUsable())
+      return NextStmt;
+
+    Stmt *Loop = NextStmt.get();
+    if (isa<AttributedStmt>(Loop))
+      Loop = cast<AttributedStmt>(Loop)->getSubStmt();
+
+    // Verify it is a loop
+    if (isa<WhileStmt>(Loop)) {
+      WhileStmt *While = cast<WhileStmt>(Loop);
+      While->addCondBrLoopHint(Hint);
+    } else if (isa<DoStmt>(Loop)) {
+      DoStmt *Do = cast<DoStmt>(Loop);
+      Do->addCondBrLoopHint(Hint);
+    } else if (isa<ForStmt>(Loop)) {
+      ForStmt *For = cast<ForStmt>(Loop);
+      For->addCondBrLoopHint(Hint);
+    }
+
+    return NextStmt;
+  } else {
+    Diag(PragmaLoc, diag::err_expected) <<
+        "for, while, or do-while loop to immediately follow pragma loop";
+  }
+
+  return StmtEmpty();
+}
+
 namespace {
   class ClangAsmParserCallback : public llvm::MCAsmParserSemaCallback {
     Parser &TheParser;
Index: test/CodeGen/pragma-vectorize.c
===================================================================
--- test/CodeGen/pragma-vectorize.c	(revision 0)
+++ test/CodeGen/pragma-vectorize.c	(working copy)
@@ -0,0 +1,53 @@
+// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s
+
+// CHECK: br i1 %cmp, label %while.body, label %while.end, !llvm.loop !1
+// CHECK: br i1 %cmp, label %do.body, label %do.end, !llvm.loop !5
+// CHECK: br i1 %cmp, label %for.body, label %for.end, !llvm.loop !7
+// CHECK: br i1 %cmp, label %for.body, label %for.end, !llvm.loop !8
+
+// CHECK: !1 = metadata !{metadata !1, metadata !2, metadata !3, metadata !4}
+// CHECK: !2 = metadata !{metadata !"llvm.vectorizer.width", i32 4}
+// CHECK: !3 = metadata !{metadata !"llvm.vectorizer.unroll", i32 4}
+// CHECK: !4 = metadata !{metadata !"llvm.vectorizer.enable", i1 true}
+// CHECK: !5 = metadata !{metadata !5, metadata !3, metadata !6}
+// CHECK: !6 = metadata !{metadata !"llvm.vectorizer.width", i32 8}
+// CHECK: !7 = metadata !{metadata !7, metadata !3, metadata !4}
+// CHECK: !8 = metadata !{metadata !8, metadata !9}
+// CHECK: !9 = metadata !{metadata !"llvm.vectorizer.width", i32 1}
+
+void while_test(int *List, int Length) {
+  int i = 0;
+
+  #pragma loop vectorize(enable)
+  #pragma loop interleave(4)
+  #pragma loop vectorize(4)
+  while(i < Length) {
+    List[i] = i*2;
+    i++;
+  }
+}
+
+void do_test(int *List, int Length) {
+  int i = 0;
+
+  #pragma loop vectorize(8) interleave(4)
+  do {
+    List[i] = i*2;
+    i++;
+  } while (i < Length);
+}
+
+void for_test(int *List, int Length) {
+  #pragma loop interleave(enable)
+  #pragma loop interleave(4)
+  for(int i = 0; i < Length; i++) {
+    List[i] = i*2;
+  }
+}
+
+void disable_test(int *List, int Length) {
+  #pragma loop vectorize(disable)
+  for(int i = 0; i < Length; i++) {
+    List[i] = i*2;
+  }
+}
Index: test/Parser/pragma-vectorize.c
===================================================================
--- test/Parser/pragma-vectorize.c	(revision 0)
+++ test/Parser/pragma-vectorize.c	(working copy)
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// Note that this puts the expected lines before the directives to work around
+// limitations in the -verify mode.
+
+void test(int *List, int Length)
+{
+  int i = 0;
+
+  #pragma loop vectorize(4)
+  #pragma loop vectorize(enable)
+  #pragma loop vectorize(disable)
+  #pragma loop interleave(8)
+  #pragma loop interleave(enable)
+  #pragma loop interleave(disable)
+  while(i < Length) {
+    List[i] = i;
+  }
+
+  #pragma loop vectorize(4) interleave(8)
+  while(i < Length) {
+    List[i] = i;
+  }
+
+/* expected-error {{expected '('}} */ #pragma loop vectorize
+/* expected-error {{expected '('}} */ #pragma loop interleave
+
+/* expected-error {{expected ')'}} */ #pragma loop vectorize(4
+/* expected-error {{expected ')'}} */ #pragma loop interleave(4
+
+/* expected-error {{expected enable, disable, or a positive integer}} */ #pragma loop vectorize(0)
+/* expected-error {{expected enable, disable, or a positive integer}} */ #pragma loop interleave(0)
+
+/* expected-error {{expected vectorize, or interleave}} */ #pragma loop
+/* expected-error {{expected vectorize, or interleave}} */ #pragma loop badkeyword
+/* expected-error {{expected vectorize, or interleave}} */ #pragma loop vectorize(4) badkeyword
+/* expected-warning {{extra tokens at end of '#pragma loop' - ignored}} */ #pragma loop vectorize(4) ,
+
+  while(i < Length) {
+    List[i] = i;
+  }
+
+/* expected-error {{expected for, while, or do-while loop to immediately follow pragma loop}} */ #pragma loop vectorize(enable)
+  int j = Length;
+  List[0] = List[1];
+
+  while(j < Length) {
+    List[j] = j;
+  }
+
+/* expected-error {{expected for, while, or do-while loop to immediately follow pragma loop}} */ #pragma loop interleave(enable)
+}
