InstCombine does some basic store to load forwarding. One case it currently misses is the case where the store is actually a memset. This patch adds support for this case. This is a minimal implementation that only handles a load at the memset base address, without an offset.
GVN is already capable of performing this optimization. Having it in InstCombine can help with phase ordering issues, similar to the existing store to load forwarding.
Do we have a negative test like this except we're 1-bit short of covering the loaded amount?
Similarly, add a negative test where there's a store or some other interference between the memset and the load?