[PATCH] D78406: [NFC][PowerPC] Add NFC changes for PCRelative feature
Victor Huang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 15:48:02 PDT 2020
NeHuang created this revision.
NeHuang added reviewers: nemanjai, lei, stefanp, power-llvm-team, hfinkel.
NeHuang added a project: LLVM.
Herald added subscribers: llvm-commits, shchenz, kbarton, hiraditya.
- Use Subtarget.isUsingPCRelativeCalls() in functionPPCTargetLowering::LowerConstantPool to check if using PCRelative addressing.
- Change MO_GOT_FLAG = 32 to MO_GOT_FLAG = 8 in PPC.h to use consecutive bits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D78406
Files:
llvm/lib/Target/PowerPC/PPC.h
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -2809,7 +2809,7 @@
// 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() || Subtarget.isAIXABI()) {
- if (Subtarget.hasPCRelativeMemops()) {
+ if (Subtarget.isUsingPCRelativeCalls()) {
SDLoc DL(CP);
EVT Ty = getPointerTy(DAG.getDataLayout());
SDValue ConstPool = DAG.getTargetConstantPool(C, Ty,
Index: llvm/lib/Target/PowerPC/PPC.h
===================================================================
--- llvm/lib/Target/PowerPC/PPC.h
+++ llvm/lib/Target/PowerPC/PPC.h
@@ -105,7 +105,7 @@
/// MO_GOT_FLAG - If this bit is set the symbol reference is to be computed
/// via the GOT. For example when combined with the MO_PCREL_FLAG it should
/// produce the relocation @got at pcrel. Fixup is VK_PPC_GOT_PCREL.
- MO_GOT_FLAG = 32,
+ MO_GOT_FLAG = 8,
/// The next are not flags but distinct values.
MO_ACCESS_MASK = 0xf00,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78406.258439.patch
Type: text/x-patch
Size: 1213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200417/5e32b573/attachment.bin>
More information about the llvm-commits
mailing list