[PATCH] D16474: Use PC-relative address for x32 TLS address

H.J Lu via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 13:55:33 PDT 2016


hjl.tools updated the summary for this revision.
hjl.tools added a subscriber: qcolombet.
hjl.tools updated this revision to Diff 56457.

http://reviews.llvm.org/D16474

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp

Index: lib/Target/X86/X86ISelDAGToDAG.cpp
===================================================================
--- lib/Target/X86/X86ISelDAGToDAG.cpp
+++ lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -1695,11 +1695,11 @@
   AM.Base_Reg = CurDAG->getRegister(0, N.getValueType());
   AM.SymbolFlags = GA->getTargetFlags();
 
-  if (N.getValueType() == MVT::i32) {
+  if (Subtarget->is32Bit()) {
     AM.Scale = 1;
     AM.IndexReg = CurDAG->getRegister(X86::EBX, MVT::i32);
   } else {
-    AM.IndexReg = CurDAG->getRegister(0, MVT::i64);
+    AM.IndexReg = CurDAG->getRegister(0, N.getValueType());
   }
 
   getAddressOperands(AM, SDLoc(N), Base, Scale, Index, Disp, Segment);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16474.56457.patch
Type: text/x-patch
Size: 669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160506/ca4b157d/attachment.bin>


More information about the llvm-commits mailing list