Move intrinsic handling out of IRState.