Extract out common code and make things safer; NFC
RowMajorMatrixVectorProductEmitter and ColumnMajorMatrixVectorProductEmitter
both cache* the generated LLVM IR by keying off the dimensions of the operation,
the primitive type etc. Before this CL the code computing the cache key lived
separately from the GEMV emitters. This pattern introduces a risk that the GEMV
emitters will end up with some state not modeled in the cache key, resulting in
a subtle bug.
This CL reduces the risk by escapsulating the cache key generation and the input
configuration to the GEMV emitters in a single class.
* In the sense that two different dot operations with the same M,K,N will share
a single LLVM IR function body.
PiperOrigin-RevId:
197628423