ir: Replace an assert with a panic.