[PATCH] D26731: X86: Simplify X86ISD::Wrapper operand checks.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 13:58:58 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL287160: X86: Simplify X86ISD::Wrapper operand checks. NFCI. (authored by pcc).

Changed prior to commit:
  https://reviews.llvm.org/D26731?vs=78128&id=78259#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26731

Files:
  llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/trunk/lib/Target/X86/X86ISelLowering.h


Index: llvm/trunk/lib/Target/X86/X86ISelLowering.h
===================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h
@@ -139,8 +139,9 @@
       /// at function entry, used for PIC code.
       GlobalBaseReg,
 
-      /// A wrapper node for TargetConstantPool,
-      /// TargetExternalSymbol, and TargetGlobalAddress.
+      /// A wrapper node for TargetConstantPool, TargetJumpTable,
+      /// TargetExternalSymbol, TargetGlobalAddress, TargetGlobalTLSAddress,
+      /// MCSymbol and TargetBlockAddress.
       Wrapper,
 
       /// Special wrapper used under X86-64 PIC mode for RIP
Index: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -1564,12 +1564,9 @@
          "Unexpected node type for MOV32ri64");
   N = N.getOperand(0);
 
-  if (N->getOpcode() != ISD::TargetConstantPool &&
-      N->getOpcode() != ISD::TargetJumpTable &&
-      N->getOpcode() != ISD::TargetGlobalAddress &&
-      N->getOpcode() != ISD::TargetExternalSymbol &&
-      N->getOpcode() != ISD::MCSymbol &&
-      N->getOpcode() != ISD::TargetBlockAddress)
+  // At least GNU as does not accept 'movl' for TPOFF relocations.
+  // FIXME: We could use 'movl' when we know we are targeting MC.
+  if (N->getOpcode() == ISD::TargetGlobalTLSAddress)
     return false;
 
   Imm = N;
@@ -1715,16 +1712,8 @@
   if (N.getOpcode() != X86ISD::Wrapper)
     return false;
 
-  unsigned Opc = N.getOperand(0)->getOpcode();
-  if (Opc == ISD::TargetConstantPool || Opc == ISD::TargetJumpTable ||
-      Opc == ISD::TargetExternalSymbol || Opc == ISD::TargetGlobalAddress ||
-      Opc == ISD::TargetGlobalTLSAddress || Opc == ISD::MCSymbol ||
-      Opc == ISD::TargetBlockAddress) {
-    Op = N.getOperand(0);
-    return true;
-  }
-
-  return false;
+  Op = N.getOperand(0);
+  return true;
 }
 
 bool X86DAGToDAGISel::tryFoldLoad(SDNode *P, SDValue N,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26731.78259.patch
Type: text/x-patch
Size: 2091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161116/55969859/attachment.bin>


More information about the llvm-commits mailing list