Remove memory writes that are overwritten by later writes. This works for StoreInsts:
store double 21.0, double* %A store double 42.0, double* %A
, scalar writes at the end of a statement and mixes of these.
Multiple writes can be the result of DeLICM, which might map multiple writes to the same location when it knows that these do no conflict (for instance because they write the same value). Such writes interfere with pattern-matched optimization such as gemm and may not get removed by other LLVM passes after code generation.