[PowerPC] Do not convert lwz to lwa if the offset is not a multiple of 4
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 31 Jan 2023 15:52:13 +0000 (09:52 -0600)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 31 Jan 2023 15:54:29 +0000 (09:54 -0600)
commit19311e0a2e70c3775a67efe55780af65eb484b41
tree3c7ebca5d8c51bbbc97f91275ee26689fb754559
parentec0f0ecd48e99ebecd224585c04c67a177543fa1
[PowerPC] Do not convert lwz to lwa if the offset is not a multiple of 4

The transform that converts this checks the alignment of the global
object being accessed. However, there was no check for the offset
within the global object which caused the compiler to produce a
DS relocation for an unaligned address.
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
llvm/test/CodeGen/PowerPC/no-misaligned-tocl.ll