remove odd mode->index, index->mode API for statistics, ir_prog already had such...