[PowerPC] Make LDtocL and friends invariant loads
authorHal Finkel <hfinkel@anl.gov>
Wed, 25 Feb 2015 21:36:59 +0000 (21:36 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 25 Feb 2015 21:36:59 +0000 (21:36 +0000)
commit7840990de8f102bf83ee297e74f225b109228512
treeee115c8e4342e2b29c0348e033acbfe8564a77b3
parente9e16aa4a5fe2da7fb9621080cc9ef13a3604549
[PowerPC] Make LDtocL and friends invariant loads

LDtocL, and other loads that roughly correspond to the TOC_ENTRY SDAG node,
represent loads from the TOC, which is invariant. As a result, these loads can
be hoisted out of loops, etc. In order to do this, we need to generate
GOT-style MMOs for TOC_ENTRY, which requires treating it as a legitimate memory
intrinsic node type. Once this is done, the MMO transfer is automatically
handled for TableGen-driven instruction selection, and for nodes generated
directly in PPCISelDAGToDAG, we need to transfer the MMOs manually.

Also, we were not transferring MMOs associated with pre-increment loads, so do
that too.

Lastly, this fixes an exposed bug where R30 was not added as a defined operand of
UpdateGBR.

This problem was highlighted by an example (used to generate the test case)
posted to llvmdev by Francois Pichet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230553 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/PowerPC/PPCInstrInfo.td
test/CodeGen/PowerPC/ldtoc-inv.ll [new file with mode: 0644]
test/CodeGen/PowerPC/ppc64le-aggregates.ll
test/CodeGen/PowerPC/tls-store2.ll
test/CodeGen/PowerPC/vec-abi-align.ll