[llvm] e20b07b - [PowerPC][Future] Add missing changes for PC Realtive addressing

Victor Huang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 08:27:46 PDT 2020


Author: Victor Huang
Date: 2020-04-23T10:26:43-05:00
New Revision: e20b07b021e7a83208ab5ea92cff0dfd3644d144

URL: https://github.com/llvm/llvm-project/commit/e20b07b021e7a83208ab5ea92cff0dfd3644d144
DIFF: https://github.com/llvm/llvm-project/commit/e20b07b021e7a83208ab5ea92cff0dfd3644d144.diff

LOG: [PowerPC][Future] Add missing changes for PC Realtive addressing

1. Use Subtarget.isUsingPCRelativeCalls() in LowerConstantPool to
check if using PCRelative addressing.

2. Change MO_GOT_FLAG = 32 to MO_GOT_FLAG = 8 in PPC.h to use
consecutive bits.

Differential Revision: https://reviews.llvm.org/D78406

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPC.h
    llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPC.h b/llvm/lib/Target/PowerPC/PPC.h
index 815c67286a2c..7e0aa2c6061d 100644
--- a/llvm/lib/Target/PowerPC/PPC.h
+++ b/llvm/lib/Target/PowerPC/PPC.h
@@ -105,7 +105,7 @@ namespace llvm {
     /// 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,

diff  --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 2922d90472ec..7df040776cfc 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -2814,7 +2814,7 @@ SDValue PPCTargetLowering::LowerConstantPool(SDValue Op,
   // 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,


        


More information about the llvm-commits mailing list