This is a fix for https://llvm.org/PR49215 either before/after we make a verifier enhancement for vector reductions with D96904.
I'm not sure what the current thinking is for pointer math/logic in IR. We allow icmp on pointer values. Therefore, we match min/max patterns, so without this patch, the vectorizer could form a vector reduction from that sequence.
But the LangRef definitions for min/max and vector reduction intrinsics do not allow pointer types:
https://llvm.org/docs/LangRef.html#llvm-smax-intrinsic
https://llvm.org/docs/LangRef.html#llvm-vector-reduce-umax-intrinsic
So we would crash/assert at some point - either in IR verification, in the cost model, or in codegen. If we do want to allow this kind of transform, we will need to update the LangRef and all of those parts of the compiler.
Personally, I'd add an else if (RecurrenceType->isIntegerTy()) here and then else return false. This seems like the place that is making the implicit assumption that the type can only be float or int.