Improve pass documentation and comments.
Patch by Matthijs Kooijman!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50861 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 87c9374b..bc19114 100644
--- a/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===//
//
// This pass munges the code in the input function to better prepare it for
-// SelectionDAG-based code generation. This works around limitations in it's
-// basic-block-at-a-time approach. It should eventually be removed.
+// SelectionDAG-based code generation. This works around limitations in it's
+// basic-block-at-a-time approach. It should eventually be removed.
//
//===----------------------------------------------------------------------===//
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index 991b111..964fe90 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -9,6 +9,23 @@
//
// This file implements the Jump Threading pass.
//
+// Jump threading tries to find distinct threads of control flow running through
+// a basic block. This pass looks at blocks that have multiple predecessors and
+// multiple successors. If one or more of the predecessors of the block can be
+// proven to always cause a jump to one of the successors, we forward the edge
+// from the predecessor to the successor by duplicating the contents of this
+// block.
+//
+// An example of when this can occur is code like this:
+//
+// if () { ...
+// X = 4;
+// }
+// if (X < 3) {
+//
+// In this case, the unconditional branch at the end of the first if can be
+// revectored to the false side of the second if.
+//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "jump-threading"
@@ -33,22 +50,6 @@
cl::init(6), cl::Hidden);
namespace {
- /// This pass performs 'jump threading', which looks at blocks that have
- /// multiple predecessors and multiple successors. If one or more of the
- /// predecessors of the block can be proven to always jump to one of the
- /// successors, we forward the edge from the predecessor to the successor by
- /// duplicating the contents of this block.
- ///
- /// An example of when this can occur is code like this:
- ///
- /// if () { ...
- /// X = 4;
- /// }
- /// if (X < 3) {
- ///
- /// In this case, the unconditional branch at the end of the first if can be
- /// revectored to the false side of the second if.
- ///
class VISIBILITY_HIDDEN JumpThreading : public FunctionPass {
public:
static char ID; // Pass identification
diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp
index 1ea2f6a..02a5ca9 100644
--- a/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -7,10 +7,10 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements the Dead Loop Elimination Pass. This pass is
-// responsible for eliminating loops with non-infinite computable trip counts
-// that have no side effects or volatile instructions, and do not contribute
-// to the computation of the function's return value.
+// This file implements the Dead Loop Deletion Pass. This pass is responsible
+// for eliminating loops with non-infinite computable trip counts that have no
+// side effects or volatile instructions, and do not contribute to the
+// computation of the function's return value.
//
//===----------------------------------------------------------------------===//