diff options
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/StripDeadPrototypes.cpp | 6 | ||||
-rw-r--r-- | lib/Transforms/IPO/StructRetPromotion.cpp | 13 | ||||
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Scalar/JumpThreading.cpp | 33 | ||||
-rw-r--r-- | lib/Transforms/Scalar/LoopDeletion.cpp | 8 |
5 files changed, 38 insertions, 26 deletions
diff --git a/lib/Transforms/IPO/StripDeadPrototypes.cpp b/lib/Transforms/IPO/StripDeadPrototypes.cpp index fd22fdb..ca8a436 100644 --- a/lib/Transforms/IPO/StripDeadPrototypes.cpp +++ b/lib/Transforms/IPO/StripDeadPrototypes.cpp @@ -1,4 +1,4 @@ -//===-- StripDeadPrototypes.cpp - Removed unused function declarations ----===// +//===-- StripDeadPrototypes.cpp - Remove unused function declarations ----===// // // The LLVM Compiler Infrastructure // @@ -8,7 +8,9 @@ //===----------------------------------------------------------------------===// // // This pass loops over all of the functions in the input module, looking for -// dead declarations and removes them. +// dead declarations and removes them. Dead declarations are declarations of +// functions for which no implementation is available (i.e., declarations for +// unused library functions). // //===----------------------------------------------------------------------===// diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp index 77a35b4..83ceb0d 100644 --- a/lib/Transforms/IPO/StructRetPromotion.cpp +++ b/lib/Transforms/IPO/StructRetPromotion.cpp @@ -1,4 +1,4 @@ -//===-- StructRetPromotion.cpp - Promote sret arguments -000000------------===// +//===-- StructRetPromotion.cpp - Promote sret arguments ------------------===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,16 @@ // //===----------------------------------------------------------------------===// // -// TODO : Describe this pass. +// This pass finds functions that return a struct (using a pointer to the struct +// as the first argument of the function, marked with the 'sret' attribute) and +// replaces them with a new function that simply returns each of the elements of +// that struct (using multiple return values). +// +// This pass works under a number of conditions: +// 1. The returned struct must not contain other structs +// 2. The returned struct must only be used to load values from +// 3. The placeholder struct passed in is the result of an alloca +// //===----------------------------------------------------------------------===// #define DEBUG_TYPE "sretpromotion" 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 @@ 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/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. // //===----------------------------------------------------------------------===// |