Support casts in IR