This could be fixed by using an extra flag in MCInstrDesc. Currently, the LSUnit in llvm-mca (LSUnit.h) doesn't know about memory-barriers. It conservatively assumes that an instruction with both 'mayLoad' and 'unmodeledSideEffects' behaves like a "soft" load barrier. Similarly, an instruction with flag 'mayStore' and 'unmodeledSideEffects' is treated like a "soft" store barrier. That means, memory operations are serialized without forcing a flush (of the load/store queue). This is inaccurate, and currently it leads to potentially incorrect analysis. If we teach llvm-mca how to correctly identify fence instructions, then the analysis becomes more accurate (and we don't need to guess anymore).