Index: lib/Transform/ScheduleOptimizer.cpp =================================================================== --- lib/Transform/ScheduleOptimizer.cpp +++ lib/Transform/ScheduleOptimizer.cpp @@ -833,6 +833,25 @@ /// to the array, and change memory access locations of the compute kernel /// to reference the array. /// +/// As an example let us consider the packing of the array A, which is +/// represented by an assess relation that has the form +/// { Stmt_for_body6[i0, i1, i2] -> MemRef_A[i0, i2] }. The scheduling function +/// of the SCoP statement Stmt_for_body6 has the form +/// { Stmt_for_body6[i0, i1, i2] -> [o0, o1, o2, o3, o4, o5, o6, o7, 0] : -i2 +/// + o5 % 256 = 0 and -i1 + o7 % 8 = 0 and i0 - o6 % 4 = 0 and -15 + i1 <= +/// 16o0 <= i1 and -255 + i2 <= 256o1 <= i2 and -95 + i0 <= 96o2 <= i0 and 0 <= +/// o5 <= 255 and 0 <= o6 <= 3 and 0 <= o7 <= 7 and -7 + i1 - 8o3 <= +/// 16*floor((i1)/16) <= i1 - 8o3 and -3 + i0 - 4o4 <= 96*floor((i0)/96) <= i0 +/// - 4o4 } +/// +/// To add a new array Packed_A[24][256][4] to the SCoP, we use +/// Scop::createScopArrayInfo(). Copying of data to the array is performed by +/// the copy statement created by Scop::addScopStmt. Changing of the memory +/// access locations to {Stmt_for_body6[i0, i1, i2] -> [o0, o1, o2] : -i2 + o1 +/// % 256 = 0 and -i0 + o2 % 4 = 0 and 0 <= o1 <= 255 and 0 <= o2 <= 3 and -3 + +/// i0 - 4o0 <= 96*floor((i0)/96) <= i0 - 4o0} is performed by +/// MemoryAccess::setNewAccessRelation. +/// /// @param Node The schedule node to be optimized. /// @param MapOldIndVar The relation, which maps original induction variables /// to the ones, which are produced by schedule