1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Reword and tidy up some comments.

llvm-svn: 70416
This commit is contained in:
Dan Gohman 2009-04-29 22:01:05 +00:00
parent e02f6210ab
commit 8b1b8d5891

View File

@ -10,33 +10,44 @@
// This file implements Loop Index Splitting Pass. This pass handles three
// kinds of loops.
//
// [1] Loop is eliminated when loop body is executed only once. For example,
// [1] A loop may be eliminated if the body is executed exactly once.
// For example,
//
// for (i = 0; i < N; ++i) {
// if (i == X) {
// ...
// body;
// }
// }
//
// [2] Loop's iteration space is shrunk if loop body is executed for certain
// range only. For example,
// is transformed to
//
// i = X;
// body;
//
// [2] A loop's iteration space may be shrunk if the loop body is executed
// for a proper sub-range of the loop's iteration space. For example,
//
// for (i = 0; i < N; ++i) {
// if (i > A && i < B) {
// ...
// }
// }
// is trnasformed to iterators from A to B, if A > 0 and B < N.
//
// [3] Loop is split if the loop body is dominated by an branch. For example,
// is transformed to iterators from A to B, if A > 0 and B < N.
//
// [3] A loop may be split if the loop body is dominated by a branch.
// For example,
//
// for (i = LB; i < UB; ++i) { if (i < SV) A; else B; }
//
// is transformed into
//
// AEV = BSV = SV
// for (i = LB; i < min(UB, AEV); ++i)
// A;
// for (i = max(LB, BSV); i < UB; ++i);
// B;
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "loop-index-split"