The logic for getProfileKind for RawInstrProfReader and InstrProfReaderIndex is similar. To avoid duplication, move the logic from the header to InstrProfReader.cpp and introduce a static method which implements the common code. Differential Revision: https://reviews.llvm.org/D118656