Towards automatic parallelization of tree reductions in dynamic programming