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

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 11:32:19 PST 2016


mgrang added a subscriber: mgrang.
mgrang added a comment.

Could you please upload your patch with more context? (Preferably the full src file).


================
Comment at: lib/Target/X86/X86ISelDAGToDAG.cpp:1682
@@ -1681,2 +1681,3 @@
 
-  if (N.getValueType() == MVT::i32) {
+  if (Subtarget->is64Bit()) {
+    AM.IndexReg = CurDAG->getRegister(0, N.getValueType());
----------------
Is there any specific reason why the if-else clauses have been reversed? i.e: why are we checking for 64 bit first? Can we still do this:

if (Subtarget->is32Bit()) {
    AM.Scale = 1;
    AM.IndexReg = CurDAG->getRegister(X86::EBX, MVT::i32);
  }
else {
   AM.IndexReg = CurDAG->getRegister(0, N.getValueType());
}


http://reviews.llvm.org/D16474





More information about the llvm-commits mailing list