Fix PPC unaligned 64-bit loads and stores
authorHal Finkel <hfinkel@anl.gov>
Mon, 18 Mar 2013 23:00:58 +0000 (23:00 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 18 Mar 2013 23:00:58 +0000 (23:00 +0000)
commitb09680b0f793254c7985dd42f3ef8ea56a388c10
treecfb7f7b75beb47c2b7766ea1d785ea164369611b
parent2428f167f72ce4f7734c6f85f70e94283cfba1c5
Fix PPC unaligned 64-bit loads and stores

PPC64 supports unaligned loads and stores of 64-bit values, but
in order to use the r+i forms, the offset must be a multiple of 4.
Unfortunately, this cannot always be determined by examining the
immediate itself because it might be available only via a TOC entry.

In order to get around this issue, we additionally predicate the
selection of the r+i form on the alignment of the load or store
(forcing it to be at least 4 in order to select the r+i form).

llvm-svn: 177338
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCInstr64Bit.td
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/test/CodeGen/PowerPC/unal4-std.ll [new file with mode: 0644]