Add a basic-block autovectorization pass.

This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

llvm-svn: 149468
diff --git a/llvm/tools/bugpoint/CMakeLists.txt b/llvm/tools/bugpoint/CMakeLists.txt
index e06feb1..ee2235b 100644
--- a/llvm/tools/bugpoint/CMakeLists.txt
+++ b/llvm/tools/bugpoint/CMakeLists.txt
@@ -1,5 +1,5 @@
 set(LLVM_LINK_COMPONENTS asmparser instrumentation scalaropts ipo
-  linker bitreader bitwriter)
+  linker bitreader bitwriter vectorize)
 
 add_llvm_tool(bugpoint
   BugDriver.cpp
diff --git a/llvm/tools/bugpoint/Makefile b/llvm/tools/bugpoint/Makefile
index eacaa47..34f4bdd 100644
--- a/llvm/tools/bugpoint/Makefile
+++ b/llvm/tools/bugpoint/Makefile
@@ -10,6 +10,6 @@
 LEVEL := ../..
 TOOLNAME := bugpoint
 LINK_COMPONENTS := asmparser instrumentation scalaropts ipo linker bitreader \
-                   bitwriter
+                   bitwriter vectorize
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-ld/CMakeLists.txt b/llvm/tools/llvm-ld/CMakeLists.txt
index 370bcb4..d328a04 100644
--- a/llvm/tools/llvm-ld/CMakeLists.txt
+++ b/llvm/tools/llvm-ld/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(LLVM_LINK_COMPONENTS ipo scalaropts linker archive bitwriter)
+set(LLVM_LINK_COMPONENTS ipo scalaropts linker archive bitwriter vectorize)
 
 add_llvm_tool(llvm-ld
   Optimize.cpp
diff --git a/llvm/tools/llvm-ld/Makefile b/llvm/tools/llvm-ld/Makefile
index 2ec6e0a..8793ca9 100644
--- a/llvm/tools/llvm-ld/Makefile
+++ b/llvm/tools/llvm-ld/Makefile
@@ -9,6 +9,6 @@
 
 LEVEL := ../..
 TOOLNAME := llvm-ld
-LINK_COMPONENTS := ipo scalaropts linker archive bitwriter
+LINK_COMPONENTS := ipo scalaropts linker archive bitwriter vectorize
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/lto/CMakeLists.txt b/llvm/tools/lto/CMakeLists.txt
index 7e2c5f0..9112976 100644
--- a/llvm/tools/lto/CMakeLists.txt
+++ b/llvm/tools/lto/CMakeLists.txt
@@ -1,6 +1,6 @@
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
-  ipo scalaropts linker bitreader bitwriter mcdisassembler)
+  ipo scalaropts linker bitreader bitwriter mcdisassembler vectorize)
 
 add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" )
 
diff --git a/llvm/tools/lto/Makefile b/llvm/tools/lto/Makefile
index ef78f82..153fa03 100644
--- a/llvm/tools/lto/Makefile
+++ b/llvm/tools/lto/Makefile
@@ -10,7 +10,7 @@
 LEVEL := ../..
 LIBRARYNAME := LTO
 LINK_COMPONENTS := all-targets ipo scalaropts linker bitreader bitwriter \
-                   mcdisassembler
+                   mcdisassembler vectorize
 LINK_LIBS_IN_SHARED := 1
 SHARED_LIBRARY := 1
 
diff --git a/llvm/tools/opt/CMakeLists.txt b/llvm/tools/opt/CMakeLists.txt
index 0570d0e..7daf22a 100644
--- a/llvm/tools/opt/CMakeLists.txt
+++ b/llvm/tools/opt/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo)
+set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo vectorize)
 
 add_llvm_tool(opt
   AnalysisWrappers.cpp
diff --git a/llvm/tools/opt/Makefile b/llvm/tools/opt/Makefile
index e8cd7e2..16d116d 100644
--- a/llvm/tools/opt/Makefile
+++ b/llvm/tools/opt/Makefile
@@ -9,6 +9,6 @@
 
 LEVEL := ../..
 TOOLNAME := opt
-LINK_COMPONENTS := bitreader bitwriter asmparser instrumentation scalaropts ipo
+LINK_COMPONENTS := bitreader bitwriter asmparser instrumentation scalaropts ipo vectorize
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 5161364..30da863 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -480,6 +480,7 @@
   PassRegistry &Registry = *PassRegistry::getPassRegistry();
   initializeCore(Registry);
   initializeScalarOpts(Registry);
+  initializeVectorization(Registry);
   initializeIPO(Registry);
   initializeAnalysis(Registry);
   initializeIPA(Registry);