As part of getting the rest of LLVM ready for opaque pointers, this adds a mandatory type/size argument to the analysis APIs in Loads.h (to avoid relying on V->getPointerElementType()).
Most callers already had a memory instruction locally they could use to provide this parameter, but two (SROA and ArgumentPromotion) were doing a more complicated analysis. I updated them to track the combined properties of the loads they are tracking.
Some of the logic is currently trivial (if one load has type T then all loads of that value will) but this implementation should be robust even when that's false and saves updating them twice.
I'd probably simplify this, eg:
Or:
(I'd potentially declare BaseTy right before UpdateBaseTy - after the comment, since it's so closely connected to that lambda)