Skip to content

loop invariant code motion for blockstructured meshes

Marcel Koch requested to merge feature/licm into master

This implements a simple 'loopinvariant code motion' algorithm for blockstructured meshes, based off !329 (closed).

The idea is to find out the minimal iname set for each sub expression and then substract these iname from the iname set of the current instruction to decide if an expression should be hoisted out.

Todo:

  • handle cse within cse
  • handle multidimensional cse
  • find terms like a * b * c; a * b * d -> _t = a * b; _t * c; _t * d
    • currently these are only found if (a * b) * c; (a * b) * d
  • handle complicated loop nestings correctly, for example jacobian kernels
    • currently it tries to do licm, if that results in kernels loopy can't schedule, then it falls back to the previous cse implementation

A full documentation of the implementation can be found in the wiki.

Edited by Marcel Koch

Merge request reports