diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 33 | ||||
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 8 |
3 files changed, 23 insertions, 22 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 87c9374b2ff..bc19114fa2d 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/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/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 991b11110b4..964fe90c467 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/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 @@ Threshold("jump-threading-threshold", 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/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp index 1ea2f6ac9ea..02a5ca98d97 100644 --- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/llvm/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. // //===----------------------------------------------------------------------===// |