GEPOperator: provide getResultElementType alongside getSourceElementType.
This is made possible by adding a result element type field to GetElementPtrConstantExpr, which GetElementPtrInst already has.
GEP: replace get(Pointer)ElementType uses with get{Source,Result}ElementType.
This seems like a slightly indirect test of the property you describe in the comment.
Do you think it might be nicer to check if the iterator is == I->op_begin() + 1? Or to add a flag of some kind before the loop for this first case? Or perhaps to use a gep type iterator in parallel with the operands? (or an assert for any of these conditions)
Not necessary, just throwing some ideas around in case any of them seem like an improvement.