on Shared-memory Multiprocessors
by
Naraig Manjikian
A thesis submitted in conformity with the requirements
for the degree of Doctor of Philosophy
Graduate Department of Electrical and Computer Engineering
University of Toronto
c Copyright by Naraig Manjikian 1997
, Abstract
Program Transformations for Cache Locality Enhancement
on Shared-memory Multiprocessors
Naraig Manjikian
Doctor of Philosophy
Graduate Department of Electrical and Computer Engineering
University of Toronto
1997
This dissertation proposes and evaluates compiler techniques that enhance cache locality
and consequently improve the performance of parallel applications on shared-memory multi-
processors. These techniques target applications with loop-level parallelism that can be detected
and exploited automatically by a compiler. Novel program transformations are combined with
appropriate loop scheduling in order to exploit data reuse while maintaining parallelism and
avoiding cache conflicts.
First, this dissertation proposes the shift-and-peel transformation for enabling loop fusion
and exploiting reuse across parallel loops. The shift-and-peel transformation overcomes depen-
dence limitations that have previously prevented loops from being fused legally, or prevented
legally-fused loops from being parallelized. Therefore, this transformation exploits all reuse
across loops without loss of parallelism.
Second, this dissertation describes and evaluates adaptations of static loop scheduling
strategies to exploit wavefront parallelism while ensuring locality in tiled loops. Wavefront
parallelism results when tiling is enabled by combining the shift-and-peel transformation with
loop skewing. Proper scheduling exploits both intratile and intertile data reuse when indepen-
dent tiles are executed in parallel on a large number of processors.
ii
, Third, this dissertation proposes cache partitioning for preventing cache conflicts between
data from different arrays, especially when exploiting reuse across loops. Specifically, cache
partitioning prevents frequently-recurring conflicts in loops with compatible data access pat-
terns. Cache partitioning transforms the data layout such that there are no conflicts for reused
data from different arrays during loop execution.
An analytical model is also presented to assess the potential benefit of locality enhancement.
This model estimates the expected reduction in execution time by parameterizing the reduction
in the number of memory accesses with locality enhancement and the contribution of memory
accesses towards execution time.
Experimental results show that the proposed techniques improve parallel performance
by 20%-60% for representative applications on contemporary multiprocessors. The results
also show that significant improvements are obtained in conjunction with other performance-
enhancing techniques such as prefetching. The importance of the techniques described in this
dissertation will continue to increase as processor performance continues to increase more
rapidly than memory performance.
iii
, Acknowledgements
First and foremost, I would like to thank my supervisor, Dr. Tarek S. Abdelrahman. For
five years, he has maintained the right balance between providing close supervision and giving
me the freedom to pursue my ideas, and he has given me much-appreciated encouragement and
advice along the path of graduate studies. His attention to my work ultimately helped ensure
its final quality.
I would also like to thank the members of my examination committee, Dr. David A. Padua,
Dr. Zvonko G. Vranesic, Dr. Kenneth C. Sevcik, Dr. Todd C. Mowry, and Dr. Stephen D.
Brown, for their careful reading and critical evaluation of my dissertation.
Access to the multiprocessor systems used in this research was provided by the University
of Michigan Center for Parallel Computing. In particular, I would like to acknowledge the
assistance of Andrew Caird of the Center of Parallel Computing.
I am grateful for the financial support that I have received during the course of my doctoral
studies. I have been supported by a Postgraduate Scholarship from the Natural Sciences and
Engineering Research Council of Canada, a University of Toronto Open Doctoral Fellowship,
and a V. L. Henderson Memorial Fellowship. Additional financial support for this research was
provided by the Natural Sciences and Engineering Research Council, and by the Information
Technology Research Centre of Ontario.
I am also grateful for the opportunity to have participated in the NUMAchine Multiprocessor
Project at the University of Toronto. I would like to thank the faculty, staff, and students involved
in the NUMAchine Project for providing me with a rewarding experience.
I would like to thank the members of my extended family for their kindness and support,
and for always providing me with a home away from home during the entire course of my
university education.
To my parents, Hagop and Dirouhie, my brother, Sevak, and my sister, Lalai, words alone
cannot convey my heartfelt gratitude. Despite my long absences, you supported all of my
scholarly endeavors. You accepted the importance of my education, and you respected my
decisions, although you gave me advice so that my direction was always clear. Let us always
celebrate our successes together.
iv