Matrix Reorganization - Matrix Flattening and Transposing optimizations

Reviewer: Diego Novillo.

The layout of data in memory can have a significant affect on the performance of applications. Matrix flattening and matrix transposing are two data layout optimizations which reorganize matrices layout in memory. The purpose of matrix flattening is replacing a m-dimensional matrix with its equivalent n-dimensional matrix, where n<m. The frequent case is when a multidimensional matrix is flattened to its equivalent one dimensional matrix. This reduces the level of indirection needed for accessing the elements of the matrix. The second optimization is matrix transposing, which swaps rows and columns, and by doing so improves cache locality.

Both optimizations are interprocedural, and use the TREE-SSA based interprocedural framework, currently on ipa branch


Delivery Date


If profiling is enabled, matrix transposing optimization can be additionally performed. In this case, we get 2x improvement on art.

Furthermore, when measured together with another data layout optimization, struct reorg, there is 5x improvement on art.


* ipa-branch

Modifications Required

Adding an ipa pass

None: MatrixReorganization (last edited 2008-01-10 19:38:57 by localhost)