prepare for regalloc and emit