Given there is a constant vector and constant scalar both are stored under the same root node, if the scalar happens to bit wise match some specific vector element, then backend may reuse vector element for the scalar store.
It seems inevitable that I need to search through store values. That kind of search is already conducted in getStoreMergeCandidates(), so I think it maybe a good place to push some addition search logic.
I added shouldReuseConstVectorForExtractStore() to bail out early if backend does not need this kind of combine.
One hack I feel like have to do is to get EXTRACT_VECTOR_ELT node from DAG under some condition. Without that I'm afraid cannot form the pattern for instruction selection. Let me know if there is any other way to achieve this in DAG. Thank you!