Commit Graph

3 Commits

Author SHA1 Message Date
Sanjay Patel f34311c402 [GlobalOpt] recompute alignments for loads and stores of updated globals
GlobalOpt can slice structs/arrays and change GEPs in the process,
but it was not updating alignments for load/store users. This
eventually causes the crashing seen in:
https://llvm.org/PR49661
https://llvm.org/PR50253

On x86, this required SLP+codegen to create an aligned vector
store on an invalid address. The bugs would be easier to
demonstrate on a target with stricter alignment requirements.

I'm not sure if this is a complete solution. The alignment
updating code is adapted from InstCombine, so I assume that
part is tested and good.

Differential Revision: https://reviews.llvm.org/D102552
2021-05-20 12:12:21 -04:00
Sanjay Patel ee4055cf23 [GlobalOpt] adjust test to show load problems; NFC
Goes with D102552
2021-05-20 12:12:21 -04:00
Sanjay Patel 23f7d651b6 [GlobalOpt] add tests for store alignment (PR50253); NFC 2021-05-15 07:31:45 -04:00