efriedma added a comment. I mean the whole foldMallocMemset transform should be in DSE. I mean, arguably the transform isn't actually eliminating a dead store, but the code you need is very similar to eliminateNoopStore. https://reviews.llvm.org/D45344