[IR] Make getFirstNonPHI return null if the BB is empty