Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: llvm/lib/Target/X86/X86ISelLowering.cpp

Issue 10826251: Cherry-pick 159409 for TLS Initial Exec fix. (Closed)
Patch Set: cherry pick instead Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | llvm/test/CodeGen/X86/tls-pie.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- X86ISelLowering.cpp - X86 DAG Lowering Implementation -------------===// 1 //===-- X86ISelLowering.cpp - X86 DAG Lowering Implementation -------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines the interfaces that X86 uses to lower LLVM code into a 10 // This file defines the interfaces that X86 uses to lower LLVM code into a
(...skipping 7467 matching lines...) Expand 10 before | Expand all | Expand 10 after
7478 SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl, 7478 SDValue TGA = DAG.getTargetGlobalAddress(GA->getGlobal(), dl,
7479 GA->getValueType(0), 7479 GA->getValueType(0),
7480 GA->getOffset(), OperandFlags); 7480 GA->getOffset(), OperandFlags);
7481 SDValue Offset = DAG.getNode(WrapperKind, dl, PtrVT, TGA); 7481 SDValue Offset = DAG.getNode(WrapperKind, dl, PtrVT, TGA);
7482 7482
7483 if (model == TLSModel::InitialExec) { 7483 if (model == TLSModel::InitialExec) {
7484 if (isPIC && !is64Bit) { 7484 if (isPIC && !is64Bit) {
7485 Offset = DAG.getNode(ISD::ADD, dl, PtrVT, 7485 Offset = DAG.getNode(ISD::ADD, dl, PtrVT,
7486 DAG.getNode(X86ISD::GlobalBaseReg, DebugLoc(), PtrVT), 7486 DAG.getNode(X86ISD::GlobalBaseReg, DebugLoc(), PtrVT),
7487 Offset); 7487 Offset);
7488 } else {
7489 Offset = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Offset,
7490 MachinePointerInfo::getGOT(), false, false, false,
7491 0);
7492 } 7488 }
7489
7490 Offset = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Offset,
7491 MachinePointerInfo::getGOT(), false, false, false,
7492 0);
7493 } 7493 }
7494 7494
7495 // The address of the thread local variable is the add of the thread 7495 // The address of the thread local variable is the add of the thread
7496 // pointer with the offset of the variable. 7496 // pointer with the offset of the variable.
7497 return DAG.getNode(ISD::ADD, dl, PtrVT, ThreadPointer, Offset); 7497 return DAG.getNode(ISD::ADD, dl, PtrVT, ThreadPointer, Offset);
7498 } 7498 }
7499 7499
7500 SDValue 7500 SDValue
7501 X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const { 7501 X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
7502 7502
(...skipping 8740 matching lines...) Expand 10 before | Expand all | Expand 10 after
16243 if (VT == MVT::f32) 16243 if (VT == MVT::f32)
16244 Res.second = &X86::FR32RegClass; 16244 Res.second = &X86::FR32RegClass;
16245 else if (VT == MVT::f64) 16245 else if (VT == MVT::f64)
16246 Res.second = &X86::FR64RegClass; 16246 Res.second = &X86::FR64RegClass;
16247 else if (X86::VR128RegClass.hasType(VT)) 16247 else if (X86::VR128RegClass.hasType(VT))
16248 Res.second = &X86::VR128RegClass; 16248 Res.second = &X86::VR128RegClass;
16249 } 16249 }
16250 16250
16251 return Res; 16251 return Res;
16252 } 16252 }
OLDNEW
« no previous file with comments | « no previous file | llvm/test/CodeGen/X86/tls-pie.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698