diff options
author | Jinsong Ji <jji@us.ibm.com> | 2019-09-20 18:21:07 +0000 |
---|---|---|
committer | Jinsong Ji <jji@us.ibm.com> | 2019-09-20 18:21:07 +0000 |
commit | e065e5f12a7de2074355e1fc3d2d1fcb4a4fcf66 (patch) | |
tree | 30b7b2030d344f673ddfae62e05265a74346f5be /llvm/lib/Target/PowerPC/PPCISelLowering.cpp | |
parent | 7dab840fd4f26fc814b323e017f549f9fb43fcd5 (diff) | |
download | bcm5719-llvm-e065e5f12a7de2074355e1fc3d2d1fcb4a4fcf66.tar.gz bcm5719-llvm-e065e5f12a7de2074355e1fc3d2d1fcb4a4fcf66.zip |
[NFC][PowerPC] Refactor classifyGlobalReference
We always(and only) check the NLP flag after calling
classifyGlobalReference to see whether it is accessed
indirectly.
Refactor to code to use isGVIndirectSym instead.
llvm-svn: 372417
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 4c846e6e753..ed9aae8f2e7 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -14555,14 +14555,8 @@ bool PPCTargetLowering::isAccessedAsGotIndirect(SDValue GA) const { if (isa<JumpTableSDNode>(GA) || isa<BlockAddressSDNode>(GA)) return true; - if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(GA)) { - const GlobalValue *GV = G->getGlobal(); - unsigned char GVFlags = Subtarget.classifyGlobalReference(GV); - // The NLP flag indicates that a global access has to use an - // extra indirection. - if (GVFlags & PPCII::MO_NLP_FLAG) - return true; - } + if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(GA)) + return Subtarget.isGVIndirectSymbol(G->getGlobal()); return false; } |