One issue that SIMD compilers must address is generating code to change the machine context, i.e., disabling processors not involved in the current computation. We present two compiler optimizations that reduce the cost of context changes. The first optimization, context partitioning, reorders the Fortran 90 code so that as subgrid loops are generated, as many statements as possible that require the same context are placed in the same loop nest. The second optimization, context splitting, splits the iteration space of the subgrid loops into sets that have invariant contexts. This allows us to hoist the code that sets the machine context out of the subgrid loops.
展开▼