made some optimizations to shift rules and cnst->reg rules