This is backwards. We should generate the first nil check and remove the second one, on pain of panicking on the wrong line.
I'm not sure whether this impacts any code in practice right now. Obvious reproducers like the one above already have their duplicate nil checks removed by the early nilcheck pass. I noticed it when implementing the TODO at the end of nilcheck2 caused the wrong nil checks to be eliminated from test/nilptr3.go.