<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/89672>89672</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            coalescing of redundant vector stores isn't preserving alignment correctly
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          regehr
      </td>
    </tr>
</table>

<pre>
    https://alive2.llvm.org/ce/z/-qQphe

optimizing this code:
```llvm
define i32 @f(ptr %0, i1 %1) {
  store <2 x i64> zeroinitializer, ptr %0, align 8
  br i1 %1, label %4, label %3

3: ; preds = %2
  store <2 x i64> zeroinitializer, ptr %0, align 16
  br label %4

4: ; preds = %3, %2
  ret i32 0
}
```

is mostly doing what we expect, but the coalesced store should retain the smaller alignnment value of the two, not the larger:
```lllvm
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write)
define noundef i32 @f(ptr nocapture writeonly %0, i1 %1) local_unnamed_addr #0 {
  store <2 x i64> zeroinitializer, ptr %0, align 16
  ret i32 0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
```

cc @nunoplopes @hatsunespica
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VM2SozYQfhpx6ZopENiYA4f5Cfc8wZaQ2qCUkEirNV7P06cEzo53apJLslUujFD313_f1ypGO3nEXhyexeG1UInnQD3hhDMVYzDXfmZeo6ifhByEHJSzbygfnXtbHgNNQg4ahRzehRwe_vx9nVGUr6J82p9hZbvYd-sn4NlG0MFgRtpNjuX-y1j7J4Nn6xFsLUE05VnI08oEQh5KIV_AVvm1ErID0T7vHgCRAyGI-kXCd7DHRtS_wTtSsN6yVc6-I2XneyDl7OTh9DfCSB_QL-DUiC6fmp9O9X1dtaifQNTPsBKaCKJ-zSbyP6dUHe9yukvkLnTzZeg6Y9ynQMhbG8ubb_v6qen3mDbCEiK7K5iQZ3WZFcMFAb-vqDlDj4mBZwQdlMOo0dxqjHNIzuRoyvrNIi7KOaS9IL-gZ3hTLiGE83bPl5ABfdgBnaIJ6StO_CBFLnZIXrMNHp6YKZMRlhR5pTARxgg-nAkRfCDUiWJ-i1evwYfkL9YbuFjnCDmRhwWXQFchT4qmBZeMdSHLKGT3Ewmzr8HzZzL6oNXKiXD3Ct5dvyKoC1q5b8l7taD5pozJo67L_4W4Hyz5xylvT8VMdkyM8RY7c6V9_iWtg39nmNa5hz75sLqw5oSaclYck8e4Wq0K09emqztVYF-1VX2SVSu7Yu7x1HXm0JywNbot1XE0Z0Q8SFO1tTw1urC9LGVTNlLKqj7I7hHHtjw2zQGr0pS6KUVT4qKs-7GyChtjwv7UHVtZbCKL2_aT0uMFtkshZV6G1GefhzFNUTSls5HjBwpbdtjfBJFVE85AaJI3KnMeNQfaZxzBRi9ky1mzEektW2-j3OShAxFqdtcikfu0bSfLcxofdViEHDZJ7H8PK4U_Nm0OW8JRyGEr6K8AAAD__1qcx-E">