[llvm] r273497 - Extract a few variables to make 'if' smaller. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 14:56:34 PDT 2016


Author: rafael
Date: Wed Jun 22 16:56:34 2016
New Revision: 273497

URL: http://llvm.org/viewvc/llvm-project?rev=273497&view=rev
Log:
Extract a few variables to make 'if' smaller. NFC.

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=273497&r1=273496&r2=273497&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Jun 22 16:56:34 2016
@@ -4284,13 +4284,14 @@ PrepareCall(SelectionDAG &DAG, SDValue &
     // A call to a TLS address is actually an indirect call to a
     // thread-specific pointer.
     unsigned OpFlags = 0;
-    if ((DAG.getTarget().getRelocationModel() != Reloc::Static &&
-         (Subtarget.getTargetTriple().isMacOSX() &&
-          Subtarget.getTargetTriple().isMacOSXVersionLT(10, 5)) &&
-         !G->getGlobal()->isStrongDefinitionForLinker()) ||
-        (Subtarget.isTargetELF() && !isPPC64 &&
-         !G->getGlobal()->hasLocalLinkage() &&
-         DAG.getTarget().getRelocationModel() == Reloc::PIC_)) {
+    Reloc::Model RM = DAG.getTarget().getRelocationModel();
+    const Triple &TargetTriple = Subtarget.getTargetTriple();
+    const GlobalValue *GV = G->getGlobal();
+    if ((RM != Reloc::Static &&
+         (TargetTriple.isMacOSX() && TargetTriple.isMacOSXVersionLT(10, 5)) &&
+         !GV->isStrongDefinitionForLinker()) ||
+        (Subtarget.isTargetELF() && !isPPC64 && !GV->hasLocalLinkage() &&
+         RM == Reloc::PIC_)) {
       // PC-relative references to external symbols should go through $stub,
       // unless we're building with the leopard linker or later, which
       // automatically synthesizes these stubs.




More information about the llvm-commits mailing list