[PowerPC] Fix problems with large code model (PR17169).
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 17 Sep 2013 20:03:25 +0000 (20:03 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 17 Sep 2013 20:03:25 +0000 (20:03 +0000)
commit5bd1dfa2b5deab10a1a7a5a4ba117c28d878595d
treec313e49febb06d1386268c994f38b7284c782e57
parent65457b679ae240c1a37da82c5484dac478c47b6d
[PowerPC] Fix problems with large code model (PR17169).

Large code model on PPC64 requires creating and referencing TOC entries when
using the addis/ld form of addressing.  This was not being done in all cases.
The changes in this patch to PPCAsmPrinter::EmitInstruction() fix this.  Two
test cases are also modified to reflect this requirement.

Fast-isel was not creating correct code for loading floating-point constants
using large code model.  This also requires the addis/ld form of addressing.
Previously we were using the addis/lfd shortcut which is only applicable to
medium code model.  One test case is modified to reflect this requirement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190882 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCFastISel.cpp
test/CodeGen/PowerPC/mcm-2.ll
test/CodeGen/PowerPC/mcm-3.ll
test/CodeGen/PowerPC/mcm-4.ll