diff options
| author | Xiangling Liao <Xiangling.Liao@ibm.com> | 2019-10-30 10:31:37 -0400 |
|---|---|---|
| committer | Xiangling Liao <Xiangling.Liao@ibm.com> | 2019-10-30 11:21:37 -0400 |
| commit | 5c9bdc79e1fcc4800ef69930e22c1ca5b61be4fb (patch) | |
| tree | 601e5a6f9f6f3e85b1d974b619f62f13c90c7db9 /llvm/lib/Target/PowerPC/PPCISelLowering.cpp | |
| parent | 70caa1fc30c392974df3bccd9959765dae1779f6 (diff) | |
| download | bcm5719-llvm-5c9bdc79e1fcc4800ef69930e22c1ca5b61be4fb.tar.gz bcm5719-llvm-5c9bdc79e1fcc4800ef69930e22c1ca5b61be4fb.zip | |
[AIX] Lowering CPI/JTI/BA to MIR
Enable lowering of constant pool index, jump table index, and bloack address to MIR on AIX.
Differential Revision: https://reviews.llvm.org/D69264
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index a2b45be72c4..87ba74cf860 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -2708,9 +2708,9 @@ SDValue PPCTargetLowering::LowerConstantPool(SDValue Op, ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op); const Constant *C = CP->getConstVal(); - // 64-bit SVR4 ABI code is always position-independent. + // 64-bit SVR4 ABI and AIX ABI code are always position-independent. // The actual address of the GlobalValue is stored in the TOC. - if (Subtarget.is64BitELFABI()) { + if (Subtarget.is64BitELFABI() || Subtarget.isAIXABI()) { setUsesTOCBasePtr(DAG); SDValue GA = DAG.getTargetConstantPool(C, PtrVT, CP->getAlignment(), 0); return getTOCEntry(DAG, SDLoc(CP), GA); @@ -2784,9 +2784,9 @@ SDValue PPCTargetLowering::LowerJumpTable(SDValue Op, SelectionDAG &DAG) const { EVT PtrVT = Op.getValueType(); JumpTableSDNode *JT = cast<JumpTableSDNode>(Op); - // 64-bit SVR4 ABI code is always position-independent. + // 64-bit SVR4 ABI and AIX ABI code are always position-independent. // The actual address of the GlobalValue is stored in the TOC. - if (Subtarget.is64BitELFABI()) { + if (Subtarget.is64BitELFABI() || Subtarget.isAIXABI()) { setUsesTOCBasePtr(DAG); SDValue GA = DAG.getTargetJumpTable(JT->getIndex(), PtrVT); return getTOCEntry(DAG, SDLoc(JT), GA); @@ -2813,9 +2813,9 @@ SDValue PPCTargetLowering::LowerBlockAddress(SDValue Op, BlockAddressSDNode *BASDN = cast<BlockAddressSDNode>(Op); const BlockAddress *BA = BASDN->getBlockAddress(); - // 64-bit SVR4 ABI code is always position-independent. + // 64-bit SVR4 ABI and AIX ABI code are always position-independent. // The actual BlockAddress is stored in the TOC. - if (Subtarget.is64BitELFABI()) { + if (Subtarget.is64BitELFABI() || Subtarget.isAIXABI()) { setUsesTOCBasePtr(DAG); SDValue GA = DAG.getTargetBlockAddress(BA, PtrVT, BASDN->getOffset()); return getTOCEntry(DAG, SDLoc(BASDN), GA); |

