Divergence Analysis with Affine Constraints - Archive ouverte HAL Access content directly
Reports (Research Report) Year : 2011

Divergence Analysis with Affine Constraints

Diogo Sampaio
  • Function : Author
  • PersonId : 1126176
Rafael Martins
  • Function : Author
  • PersonId : 1126177
Caroline Collange
Fernando Magno
  • Function : Author
  • PersonId : 995420
Quintão Pereira
  • Function : Author


The rise of graphics processing units in high-performance computing is bringing renewed interest in code optimization techniques that target SIMD processors. Many of these optimizations rely on divergence analyses, which classify variables as uniform, if they have the same value on every thread, or divergent, if they might not. This paper introduces a new kind of divergence analysis, that is able to represent variables as affine functions of thread identifiers. We have implemented our divergence analysis with affine constraints on top of Ocelot, an open source compiler, and use it to analyze a suite of 177 CUDA kernels from well-known benchmarks. These experiments show that our algorithm reports 4% less divergent variables than the previous state-of-the-art algorithm of Coutinho et al. Furthermore, we can mark about one fourth of all divergent variables as affine functions of thread identifiers. In addition to the novel divergence analysis, we also introduce the notion of a divergence aware register allocator. This allocator uses information from our analysis to either rematerialize affine variables, or to move uniform variables to shared memory. As a testimony of its effectiveness, our divergence aware allocator produces GPU code that is 29.70% faster than the code produced by Ocelot's register allocator.
Fichier principal
Vignette du fichier
Sampaio_DivergenceAnalysisAffine_SBAC12.pdf (372.08 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-00650235 , version 1 (09-12-2011)


  • HAL Id : hal-00650235 , version 1


Diogo Sampaio, Rafael Martins, Fernando Magno Quintão Pereira, Caroline Collange, Fernando Magno, et al.. Divergence Analysis with Affine Constraints. [Research Report] ENS Lyon. 2011. ⟨hal-00650235⟩
681 View
496 Download


Gmail Facebook Twitter LinkedIn More