Remove the ScalarReplAggregates pass

Nearly all the changes to this pass have been done while maintaining and
updating other parts of LLVM.  LLVM has had another pass, SROA, which
has superseded ScalarReplAggregates for quite some time.

Differential Revision: http://reviews.llvm.org/D21316

llvm-svn: 272737
diff --git a/llvm/docs/Atomics.rst b/llvm/docs/Atomics.rst
index 89f5f44..def927d 100644
--- a/llvm/docs/Atomics.rst
+++ b/llvm/docs/Atomics.rst
@@ -398,7 +398,7 @@
   MemoryDependencyAnalysis (which is also used by other passes like GVN).
 
 * Folding a load: Any atomic load from a constant global can be constant-folded,
-  because it cannot be observed.  Similar reasoning allows scalarrepl with
+  because it cannot be observed.  Similar reasoning allows sroa with
   atomic loads and stores.
 
 Atomics and Codegen
diff --git a/llvm/docs/Passes.rst b/llvm/docs/Passes.rst
index 2b5b85e..77461f3 100644
--- a/llvm/docs/Passes.rst
+++ b/llvm/docs/Passes.rst
@@ -947,7 +947,7 @@
 the entry block is split into two, such that all introduced ``alloca``
 instructions (and nothing else) are in the entry block.
 
-``-scalarrepl``: Scalar Replacement of Aggregates (DT)
+``-sroa``: Scalar Replacement of Aggregates
 ------------------------------------------------------
 
 The well-known scalar replacement of aggregates transformation.  This transform
@@ -956,12 +956,6 @@
 possible, it transforms the individual ``alloca`` instructions into nice clean
 scalar SSA form.
 
-This combines a simple scalar replacement of aggregates algorithm with the
-:ref:`mem2reg <passes-mem2reg>` algorithm because they often interact,
-especially for C++ programs.  As such, iterating between ``scalarrepl``, then
-:ref:`mem2reg <passes-mem2reg>` until we run out of things to promote works
-well.
-
 .. _passes-sccp:
 
 ``-sccp``: Sparse Conditional Constant Propagation
diff --git a/llvm/docs/tutorial/LangImpl7.rst b/llvm/docs/tutorial/LangImpl7.rst
index efc38f62..68a86ed 100644
--- a/llvm/docs/tutorial/LangImpl7.rst
+++ b/llvm/docs/tutorial/LangImpl7.rst
@@ -224,7 +224,7 @@
    class <../LangRef.html#first-class-types>`_ values (such as pointers,
    scalars and vectors), and only if the array size of the allocation is
    1 (or missing in the .ll file). mem2reg is not capable of promoting
-   structs or arrays to registers. Note that the "scalarrepl" pass is
+   structs or arrays to registers. Note that the "sroa" pass is
    more powerful and can promote structs, "unions", and arrays in many
    cases.
 
diff --git a/llvm/docs/tutorial/OCamlLangImpl7.rst b/llvm/docs/tutorial/OCamlLangImpl7.rst
index c8c701b..f36845c 100644
--- a/llvm/docs/tutorial/OCamlLangImpl7.rst
+++ b/llvm/docs/tutorial/OCamlLangImpl7.rst
@@ -224,7 +224,7 @@
    class <../LangRef.html#first-class-types>`_ values (such as pointers,
    scalars and vectors), and only if the array size of the allocation is
    1 (or missing in the .ll file). mem2reg is not capable of promoting
-   structs or arrays to registers. Note that the "scalarrepl" pass is
+   structs or arrays to registers. Note that the "sroa" pass is
    more powerful and can promote structs, "unions", and arrays in many
    cases.