Currently the SPIRVSubtarget class has limited ability to determine the current execution model. It provides distinction between Kernel and Shader environment but doesn't allow further distinction within the Shader environment to determine if in Vertex, Fragment, etc. execution models.
SPIRVCallLowering.cpp contains getExecutionModel which implements this by reading the "hlsl.shader" attribute from the passed Function but this path is not always available. Ideally the SPIRVSubtarget could be queried for the current execution model.