[SDAG] fix miscompile from merging stores of different sizes
As shown in: https://llvm.org/PR50623 ...and the similar tests here, we were not accounting for store merging of different sizes that do not cover the entire range of the wide value to be stored. This is the easy fix: just make sure that all of the original stores are the same size, so when we calculate the wide width, it's a simple N * M check. This still allows all of the motivating optimizations from: D86420 / 54a5dd48 D87112 / 7a06b166 We could enhance this code to track individual bytes and allow merging multiple sizes.
Loading
Please sign in to comment