fix a bug which produces wrong register representation in IR