aliasPHI assumes that a phi node must have at least one input. Our internal code base with some jumpthreading changes was able to get into this code with a phi with no inputs in some unreachable code.
It seems robust to not have this assumption.
I don't have a test case that works on trunk.