[PATCH] D16474: Use PC-relative address for x32 TLS address
H.J Lu via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 22 10:45:28 PST 2016
hjl.tools created this revision.
hjl.tools added reviewers: zansari, DavidKreitzer.
hjl.tools added a subscriber: llvm-commits.
Since x32 supports PC-relative address, it shouldn't use EBX for TLS
address. Instead of checking N.getValueType(), we should check
Subtarget->is64Bit(). This fixes PR 22676.
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
@@ -1679,11 +1679,11 @@
AM.Base_Reg = CurDAG->getRegister(0, N.getValueType());
AM.SymbolFlags = GA->getTargetFlags();
- if (N.getValueType() == MVT::i32) {
+ if (Subtarget->is64Bit()) {
+ AM.IndexReg = CurDAG->getRegister(0, N.getValueType());
+ } else {
AM.Scale = 1;
AM.IndexReg = CurDAG->getRegister(X86::EBX, MVT::i32);
- } else {
- AM.IndexReg = CurDAG->getRegister(0, MVT::i64);
}
getAddressOperands(AM, SDLoc(N), Base, Scale, Index, Disp, Segment);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16474.45704.patch
Type: text/x-patch
Size: 681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160122/1b364c5b/attachment.bin>
More information about the llvm-commits
mailing list