R600/structurizer: add class to find the Nearest Common Dominator