Set the default insert point to the first instruction, and not to end()
[oota-llvm.git] / lib / Transforms / Vectorize / SLPVectorizer.cpp
index cfb5be77a4a31f58c845a6f2f4cd47bde0482dac..93ff1f7e5b58c36f5f1345011a393ec2f6a10006 100644 (file)
@@ -1217,7 +1217,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
 }
 
 void BoUpSLP::vectorizeTree() {
-  Builder.SetInsertPoint(&F->getEntryBlock());
+  Builder.SetInsertPoint(F->getEntryBlock().begin());
   vectorizeTree(&VectorizableTree[0]);
 
   // For each vectorized value: