llvm.org GIT mirror llvm / de0129a
PseudoSourceValue: Replace global manager with a manager in a machine function. This commit removes the global manager variable which is responsible for storing and allocating pseudo source values and instead it introduces a new manager class named 'PseudoSourceValueManager'. Machine functions now own an instance of the pseudo source value manager class. This commit also modifies the 'get...' methods in the 'MachinePointerInfo' class to construct pseudo source values using the instance of the pseudo source value manager object from the machine function. This commit updates calls to the 'get...' methods from the 'MachinePointerInfo' class in a lot of different files because those calls now need to pass in a reference to a machine function to those methods. This change will make it easier to serialize pseudo source values as it will enable me to transform the mips specific MipsCallEntry PseudoSourceValue subclass into two target independent subclasses. Reviewers: Akira Hatanaka git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244693 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Lorenz 4 years ago
51 changed file(s) with 609 addition(s) and 565 deletion(s). Raw diff Collapse all Expand all
3737 class MachineModuleInfo;
3838 class MCContext;
3939 class Pass;
40 class PseudoSourceValueManager;
4041 class TargetMachine;
4142 class TargetSubtargetInfo;
4243 class TargetRegisterClass;
144145 /// True if the function includes any inline assembly.
145146 bool HasInlineAsm;
146147
148 // Allocation management for pseudo source values.
149 std::unique_ptr PSVManager;
150
147151 MachineFunction(const MachineFunction &) = delete;
148152 void operator=(const MachineFunction&) = delete;
149153 public:
153157
154158 MachineModuleInfo &getMMI() const { return MMI; }
155159 MCContext &getContext() const { return Ctx; }
160
161 PseudoSourceValueManager &getPSVManager() const { return *PSVManager; }
156162
157163 /// Return the DataLayout attached to the Module associated to this MF.
158164 const DataLayout &getDataLayout() const;
2626 class FoldingSetNodeID;
2727 class MDNode;
2828 class raw_ostream;
29 class MachineFunction;
2930 class ModuleSlotTracker;
3031
3132 /// MachinePointerInfo - This class contains a discriminated union of
6162
6263 /// getConstantPool - Return a MachinePointerInfo record that refers to the
6364 /// constant pool.
64 static MachinePointerInfo getConstantPool();
65 static MachinePointerInfo getConstantPool(MachineFunction &MF);
6566
6667 /// getFixedStack - Return a MachinePointerInfo record that refers to the
6768 /// the specified FrameIndex.
68 static MachinePointerInfo getFixedStack(int FI, int64_t offset = 0);
69 static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI,
70 int64_t Offset = 0);
6971
7072 /// getJumpTable - Return a MachinePointerInfo record that refers to a
7173 /// jump table entry.
72 static MachinePointerInfo getJumpTable();
74 static MachinePointerInfo getJumpTable(MachineFunction &MF);
7375
7476 /// getGOT - Return a MachinePointerInfo record that refers to a
7577 /// GOT entry.
76 static MachinePointerInfo getGOT();
78 static MachinePointerInfo getGOT(MachineFunction &MF);
7779
7880 /// getStack - stack pointer relative access.
79 static MachinePointerInfo getStack(int64_t Offset);
81 static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset);
8082 };
8183
8284
1414 #define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H
1515
1616 #include "llvm/IR/Value.h"
17 #include
1718
1819 namespace llvm {
1920
6263 /// Return true if the memory pointed to by this PseudoSourceValue can ever
6364 /// alias an LLVM IR Value.
6465 virtual bool mayAlias(const MachineFrameInfo *) const;
65
66 /// A pseudo source value referencing a fixed stack frame entry,
67 /// e.g., a spill slot.
68 static const PseudoSourceValue *getFixedStack(int FI);
69
70 /// A pseudo source value referencing the area below the stack frame of
71 /// a function, e.g., the argument space.
72 static const PseudoSourceValue *getStack();
73
74 /// A pseudo source value referencing the global offset table
75 /// (or something the like).
76 static const PseudoSourceValue *getGOT();
77
78 /// A pseudo source value referencing the constant pool. Since constant
79 /// pools are constant, this doesn't need to identify a specific constant
80 /// pool entry.
81 static const PseudoSourceValue *getConstantPool();
82
83 /// A pseudo source value referencing a jump table. Since jump tables are
84 /// constant, this doesn't need to identify a specific jump table.
85 static const PseudoSourceValue *getJumpTable();
8666 };
8767
8868 /// A specialized PseudoSourceValue for holding FixedStack values, which must
10989 int getFrameIndex() const { return FI; }
11090 };
11191
92 /// Manages creation of pseudo source values.
93 class PseudoSourceValueManager {
94 const PseudoSourceValue StackPSV, GOTPSV, JumpTablePSV, ConstantPoolPSV;
95 std::map> FSValues;
96
97 public:
98 PseudoSourceValueManager();
99
100 /// Return a pseudo source value referencing the area below the stack frame of
101 /// a function, e.g., the argument space.
102 const PseudoSourceValue *getStack();
103
104 /// Return a pseudo source value referencing the global offset table
105 /// (or something the like).
106 const PseudoSourceValue *getGOT();
107
108 /// Return a pseudo source value referencing the constant pool. Since constant
109 /// pools are constant, this doesn't need to identify a specific constant
110 /// pool entry.
111 const PseudoSourceValue *getConstantPool();
112
113 /// Return a pseudo source value referencing a jump table. Since jump tables
114 /// are constant, this doesn't need to identify a specific jump table.
115 const PseudoSourceValue *getJumpTable();
116
117 /// Return a pseudo source value referencing a fixed stack frame entry,
118 /// e.g., a spill slot.
119 const PseudoSourceValue *getFixedStack(int FI);
120 };
121
112122 } // end namespace llvm
113123
114124 #endif
2525 #include "llvm/CodeGen/MachineModuleInfo.h"
2626 #include "llvm/CodeGen/MachineRegisterInfo.h"
2727 #include "llvm/CodeGen/Passes.h"
28 #include "llvm/CodeGen/PseudoSourceValue.h"
2829 #include "llvm/IR/DataLayout.h"
2930 #include "llvm/IR/DebugInfo.h"
3031 #include "llvm/IR/Function.h"
8990 assert(TM.isCompatibleDataLayout(getDataLayout()) &&
9091 "Can't create a MachineFunction using a Module with a "
9192 "Target-incompatible DataLayout attached\n");
93
94 PSVManager = llvm::make_unique();
9295 }
9396
9497 MachineFunction::~MachineFunction() {
442442
443443 /// getConstantPool - Return a MachinePointerInfo record that refers to the
444444 /// constant pool.
445 MachinePointerInfo MachinePointerInfo::getConstantPool() {
446 return MachinePointerInfo(PseudoSourceValue::getConstantPool());
445 MachinePointerInfo MachinePointerInfo::getConstantPool(MachineFunction &MF) {
446 return MachinePointerInfo(MF.getPSVManager().getConstantPool());
447447 }
448448
449449 /// getFixedStack - Return a MachinePointerInfo record that refers to the
450450 /// the specified FrameIndex.
451 MachinePointerInfo MachinePointerInfo::getFixedStack(int FI, int64_t offset) {
452 return MachinePointerInfo(PseudoSourceValue::getFixedStack(FI), offset);
453 }
454
455 MachinePointerInfo MachinePointerInfo::getJumpTable() {
456 return MachinePointerInfo(PseudoSourceValue::getJumpTable());
457 }
458
459 MachinePointerInfo MachinePointerInfo::getGOT() {
460 return MachinePointerInfo(PseudoSourceValue::getGOT());
461 }
462
463 MachinePointerInfo MachinePointerInfo::getStack(int64_t Offset) {
464 return MachinePointerInfo(PseudoSourceValue::getStack(), Offset);
451 MachinePointerInfo MachinePointerInfo::getFixedStack(MachineFunction &MF,
452 int FI, int64_t Offset) {
453 return MachinePointerInfo(MF.getPSVManager().getFixedStack(FI), Offset);
454 }
455
456 MachinePointerInfo MachinePointerInfo::getJumpTable(MachineFunction &MF) {
457 return MachinePointerInfo(MF.getPSVManager().getJumpTable());
458 }
459
460 MachinePointerInfo MachinePointerInfo::getGOT(MachineFunction &MF) {
461 return MachinePointerInfo(MF.getPSVManager().getGOT());
462 }
463
464 MachinePointerInfo MachinePointerInfo::getStack(MachineFunction &MF,
465 int64_t Offset) {
466 return MachinePointerInfo(MF.getPSVManager().getStack(), Offset);
465467 }
466468
467469 MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, unsigned f,
921921 for (MachineInstr::mmo_iterator I = MI.memoperands_begin(),
922922 E = MI.memoperands_end(); I != E; ++I) {
923923 if (const PseudoSourceValue *PSV = (*I)->getPseudoValue()) {
924 if (PSV == PSV->getGOT() || PSV == PSV->getConstantPool())
924 if (PSV->isGOT() || PSV->isConstantPool())
925925 return true;
926926 }
927927 }
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "llvm/ADT/STLExtras.h"
1314 #include "llvm/CodeGen/PseudoSourceValue.h"
1415 #include "llvm/CodeGen/MachineFrameInfo.h"
1516 #include "llvm/IR/DerivedTypes.h"
2122 #include
2223 using namespace llvm;
2324
24 namespace {
25 struct PSVGlobalsTy {
26 // PseudoSourceValues are immutable so don't need locking.
27 const PseudoSourceValue StackPSV, GOTPSV, JumpTablePSV, ConstantPoolPSV;
28 sys::Mutex Lock; // Guards FSValues, but not the values inside it.
29 std::map FSValues;
30
31 PSVGlobalsTy()
32 : StackPSV(PseudoSourceValue::Stack), GOTPSV(PseudoSourceValue::GOT),
33 JumpTablePSV(PseudoSourceValue::JumpTable),
34 ConstantPoolPSV(PseudoSourceValue::ConstantPool) {}
35 ~PSVGlobalsTy() {
36 for (std::map::iterator
37 I = FSValues.begin(),
38 E = FSValues.end();
39 I != E; ++I) {
40 delete I->second;
41 }
42 }
43 };
44
45 static ManagedStatic PSVGlobals;
46
47 } // anonymous namespace
48
49 const PseudoSourceValue *PseudoSourceValue::getStack() {
50 return &PSVGlobals->StackPSV;
51 }
52 const PseudoSourceValue *PseudoSourceValue::getGOT() {
53 return &PSVGlobals->GOTPSV;
54 }
55 const PseudoSourceValue *PseudoSourceValue::getJumpTable() {
56 return &PSVGlobals->JumpTablePSV;
57 }
58 const PseudoSourceValue *PseudoSourceValue::getConstantPool() {
59 return &PSVGlobals->ConstantPoolPSV;
60 }
61
6225 static const char *const PSVNames[] = {
6326 "Stack", "GOT", "JumpTable", "ConstantPool", "FixedStack", "MipsCallEntry"};
6427
6831
6932 void PseudoSourceValue::printCustom(raw_ostream &O) const {
7033 O << PSVNames[Kind];
71 }
72
73 const PseudoSourceValue *PseudoSourceValue::getFixedStack(int FI) {
74 PSVGlobalsTy &PG = *PSVGlobals;
75 sys::ScopedLock locked(PG.Lock);
76 const PseudoSourceValue *&V = PG.FSValues[FI];
77 if (!V)
78 V = new FixedStackPseudoSourceValue(FI);
79 return V;
8034 }
8135
8236 bool PseudoSourceValue::isConstant(const MachineFrameInfo *) const {
12074 void FixedStackPseudoSourceValue::printCustom(raw_ostream &OS) const {
12175 OS << "FixedStack" << FI;
12276 }
77
78 PseudoSourceValueManager::PseudoSourceValueManager()
79 : StackPSV(PseudoSourceValue::Stack), GOTPSV(PseudoSourceValue::GOT),
80 JumpTablePSV(PseudoSourceValue::JumpTable),
81 ConstantPoolPSV(PseudoSourceValue::ConstantPool) {}
82
83 const PseudoSourceValue *PseudoSourceValueManager::getStack() {
84 return &StackPSV;
85 }
86
87 const PseudoSourceValue *PseudoSourceValueManager::getGOT() { return &GOTPSV; }
88
89 const PseudoSourceValue *PseudoSourceValueManager::getConstantPool() {
90 return &ConstantPoolPSV;
91 }
92
93 const PseudoSourceValue *PseudoSourceValueManager::getJumpTable() {
94 return &JumpTablePSV;
95 }
96
97 const PseudoSourceValue *PseudoSourceValueManager::getFixedStack(int FI) {
98 std::unique_ptr &V = FSValues[FI];
99 if (!V)
100 V = llvm::make_unique(FI);
101 return V.get();
102 }
1342813428 CPIdx = DAG.getNode(ISD::ADD, DL, CPIdx.getValueType(), CPIdx,
1342913429 CstOffset);
1343013430 AddToWorklist(CPIdx.getNode());
13431 return DAG.getLoad(TV->getValueType(0), DL, DAG.getEntryNode(), CPIdx,
13432 MachinePointerInfo::getConstantPool(), false,
13433 false, false, Alignment);
13431 return DAG.getLoad(
13432 TV->getValueType(0), DL, DAG.getEntryNode(), CPIdx,
13433 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
13434 false, false, false, Alignment);
1343413435 }
1343513436 }
1343613437
272272 DAG.getConstantPool(LLVMC, TLI.getPointerTy(DAG.getDataLayout()));
273273 unsigned Alignment = cast(CPIdx)->getAlignment();
274274 if (Extend) {
275 SDValue Result =
276 DAG.getExtLoad(ISD::EXTLOAD, dl, OrigVT,
277 DAG.getEntryNode(),
278 CPIdx, MachinePointerInfo::getConstantPool(),
279 VT, false, false, false, Alignment);
275 SDValue Result = DAG.getExtLoad(
276 ISD::EXTLOAD, dl, OrigVT, DAG.getEntryNode(), CPIdx,
277 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), VT,
278 false, false, false, Alignment);
280279 return Result;
281280 }
282281 SDValue Result =
283 DAG.getLoad(OrigVT, dl, DAG.getEntryNode(), CPIdx,
284 MachinePointerInfo::getConstantPool(), false, false, false,
285 Alignment);
282 DAG.getLoad(OrigVT, dl, DAG.getEntryNode(), CPIdx,
283 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
284 false, false, false, Alignment);
286285 return Result;
287286 }
288287
593592 int SPFI = cast(StackPtr.getNode())->getIndex();
594593
595594 // Store the vector.
596 SDValue Ch = DAG.getStore(DAG.getEntryNode(), dl, Tmp1, StackPtr,
597 MachinePointerInfo::getFixedStack(SPFI),
598 false, false, 0);
595 SDValue Ch = DAG.getStore(
596 DAG.getEntryNode(), dl, Tmp1, StackPtr,
597 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI), false,
598 false, 0);
599599
600600 // Truncate or zero extend offset to target pointer type.
601601 Tmp3 = DAG.getZExtOrTrunc(Tmp3, dl, PtrVT);
608608 Ch = DAG.getTruncStore(Ch, dl, Tmp2, StackPtr2, MachinePointerInfo(), EltVT,
609609 false, false, 0);
610610 // Load the updated vector.
611 return DAG.getLoad(VT, dl, Ch, StackPtr,
612 MachinePointerInfo::getFixedStack(SPFI), false, false,
613 false, 0);
611 return DAG.getLoad(VT, dl, Ch, StackPtr, MachinePointerInfo::getFixedStack(
612 DAG.getMachineFunction(), SPFI),
613 false, false, false, 0);
614614 }
615615
616616
14771477
14781478 SDValue StackPtr = DAG.CreateStackTemporary(Vec.getValueType());
14791479 int FI = cast(StackPtr.getNode())->getIndex();
1480 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(FI);
1480 MachinePointerInfo PtrInfo =
1481 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
14811482
14821483 // First store the whole vector.
14831484 SDValue Ch = DAG.getStore(DAG.getEntryNode(), dl, Vec, StackPtr, PtrInfo,
15151516 SDLoc dl(Node);
15161517 SDValue FIPtr = DAG.CreateStackTemporary(VT);
15171518 int FI = cast(FIPtr.getNode())->getIndex();
1518 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(FI);
1519 MachinePointerInfo PtrInfo =
1520 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
15191521
15201522 // Emit a store of each element to the stack slot.
15211523 SmallVector Stores;
17851787
17861788 FrameIndexSDNode *StackPtrFI = cast(FIPtr);
17871789 int SPFI = StackPtrFI->getIndex();
1788 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(SPFI);
1790 MachinePointerInfo PtrInfo =
1791 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI);
17891792
17901793 unsigned SrcSize = SrcOp.getValueType().getSizeInBits();
17911794 unsigned SlotSize = SlotVT.getSizeInBits();
18251828 FrameIndexSDNode *StackPtrFI = cast(StackPtr);
18261829 int SPFI = StackPtrFI->getIndex();
18271830
1828 SDValue Ch = DAG.getTruncStore(DAG.getEntryNode(), dl, Node->getOperand(0),
1829 StackPtr,
1830 MachinePointerInfo::getFixedStack(SPFI),
1831 Node->getValueType(0).getVectorElementType(),
1832 false, false, 0);
1833 return DAG.getLoad(Node->getValueType(0), dl, Ch, StackPtr,
1834 MachinePointerInfo::getFixedStack(SPFI),
1835 false, false, false, 0);
1831 SDValue Ch = DAG.getTruncStore(
1832 DAG.getEntryNode(), dl, Node->getOperand(0), StackPtr,
1833 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI),
1834 Node->getValueType(0).getVectorElementType(), false, false, 0);
1835 return DAG.getLoad(
1836 Node->getValueType(0), dl, Ch, StackPtr,
1837 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI), false,
1838 false, false, 0);
18361839 }
18371840
18381841 static bool
19982001 SDValue CPIdx =
19992002 DAG.getConstantPool(CP, TLI.getPointerTy(DAG.getDataLayout()));
20002003 unsigned Alignment = cast(CPIdx)->getAlignment();
2001 return DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
2002 MachinePointerInfo::getConstantPool(),
2003 false, false, false, Alignment);
2004 return DAG.getLoad(
2005 VT, dl, DAG.getEntryNode(), CPIdx,
2006 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2007 false, false, Alignment);
20042008 }
20052009
20062010 SmallSet DefinedValues;
25982602 Alignment = std::min(Alignment, 4u);
25992603 SDValue FudgeInReg;
26002604 if (DestVT == MVT::f32)
2601 FudgeInReg = DAG.getLoad(MVT::f32, dl, DAG.getEntryNode(), CPIdx,
2602 MachinePointerInfo::getConstantPool(),
2603 false, false, false, Alignment);
2605 FudgeInReg = DAG.getLoad(
2606 MVT::f32, dl, DAG.getEntryNode(), CPIdx,
2607 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2608 false, false, Alignment);
26042609 else {
2605 SDValue Load = DAG.getExtLoad(ISD::EXTLOAD, dl, DestVT,
2606 DAG.getEntryNode(), CPIdx,
2607 MachinePointerInfo::getConstantPool(),
2608 MVT::f32, false, false, false, Alignment);
2610 SDValue Load = DAG.getExtLoad(
2611 ISD::EXTLOAD, dl, DestVT, DAG.getEntryNode(), CPIdx,
2612 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), MVT::f32,
2613 false, false, false, Alignment);
26092614 HandleSDNode Handle(Load);
26102615 LegalizeOp(Load.getNode());
26112616 FudgeInReg = Handle.getValue();
38543859 Index, Table);
38553860
38563861 EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), EntrySize * 8);
3857 SDValue LD = DAG.getExtLoad(ISD::SEXTLOAD, dl, PTy, Chain, Addr,
3858 MachinePointerInfo::getJumpTable(), MemVT,
3859 false, false, false, 0);
3862 SDValue LD = DAG.getExtLoad(
3863 ISD::SEXTLOAD, dl, PTy, Chain, Addr,
3864 MachinePointerInfo::getJumpTable(DAG.getMachineFunction()), MemVT,
3865 false, false, false, 0);
38603866 Addr = LD;
38613867 if (TM.getRelocationModel() == Reloc::PIC_) {
38623868 // For PIC, the sequence is:
29832983
29842984 // Load the value out, extending it from f32 to the destination float type.
29852985 // FIXME: Avoid the extend by constructing the right constant pool?
2986 SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, dl, DstVT, DAG.getEntryNode(),
2987 FudgePtr,
2988 MachinePointerInfo::getConstantPool(),
2989 MVT::f32,
2990 false, false, false, Alignment);
2986 SDValue Fudge = DAG.getExtLoad(
2987 ISD::EXTLOAD, dl, DstVT, DAG.getEntryNode(), FudgePtr,
2988 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), MVT::f32,
2989 false, false, false, Alignment);
29912990 return DAG.getNode(ISD::FADD, dl, DstVT, SignedConv, Fudge);
29922991 }
29932992
160160 NOutVT.getTypeForEVT(*DAG.getContext()));
161161 SDValue StackPtr = DAG.CreateStackTemporary(InVT, Alignment);
162162 int SPFI = cast(StackPtr.getNode())->getIndex();
163 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(SPFI);
163 MachinePointerInfo PtrInfo =
164 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SPFI);
164165
165166 // Emit a store to the stack slot.
166167 SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, InOp, StackPtr, PtrInfo,
48774877 /// MachinePointerInfo record from it. This is particularly useful because the
48784878 /// code generator has many cases where it doesn't bother passing in a
48794879 /// MachinePointerInfo to getLoad or getStore when it has "FI+Cst".
4880 static MachinePointerInfo InferPointerInfo(SDValue Ptr, int64_t Offset = 0) {
4880 static MachinePointerInfo InferPointerInfo(SelectionDAG &DAG, SDValue Ptr,
4881 int64_t Offset = 0) {
48814882 // If this is FI+Offset, we can model it.
48824883 if (const FrameIndexSDNode *FI = dyn_cast(Ptr))
4883 return MachinePointerInfo::getFixedStack(FI->getIndex(), Offset);
4884 return MachinePointerInfo::getFixedStack(DAG.getMachineFunction(),
4885 FI->getIndex(), Offset);
48844886
48854887 // If this is (FI+Offset1)+Offset2, we can model it.
48864888 if (Ptr.getOpcode() != ISD::ADD ||
48894891 return MachinePointerInfo();
48904892
48914893 int FI = cast(Ptr.getOperand(0))->getIndex();
4892 return MachinePointerInfo::getFixedStack(FI, Offset+
4893 cast(Ptr.getOperand(1))->getSExtValue());
4894 return MachinePointerInfo::getFixedStack(
4895 DAG.getMachineFunction(), FI,
4896 Offset + cast(Ptr.getOperand(1))->getSExtValue());
48944897 }
48954898
48964899 /// InferPointerInfo - If the specified ptr/offset is a frame index, infer a
48974900 /// MachinePointerInfo record from it. This is particularly useful because the
48984901 /// code generator has many cases where it doesn't bother passing in a
48994902 /// MachinePointerInfo to getLoad or getStore when it has "FI+Cst".
4900 static MachinePointerInfo InferPointerInfo(SDValue Ptr, SDValue OffsetOp) {
4903 static MachinePointerInfo InferPointerInfo(SelectionDAG &DAG, SDValue Ptr,
4904 SDValue OffsetOp) {
49014905 // If the 'Offset' value isn't a constant, we can't handle this.
49024906 if (ConstantSDNode *OffsetNode = dyn_cast(OffsetOp))
4903 return InferPointerInfo(Ptr, OffsetNode->getSExtValue());
4907 return InferPointerInfo(DAG, Ptr, OffsetNode->getSExtValue());
49044908 if (OffsetOp.getOpcode() == ISD::UNDEF)
4905 return InferPointerInfo(Ptr);
4909 return InferPointerInfo(DAG, Ptr);
49064910 return MachinePointerInfo();
49074911 }
49084912
49314935 // If we don't have a PtrInfo, infer the trivial frame index case to simplify
49324936 // clients.
49334937 if (PtrInfo.V.isNull())
4934 PtrInfo = InferPointerInfo(Ptr, Offset);
4938 PtrInfo = InferPointerInfo(*this, Ptr, Offset);
49354939
49364940 MachineFunction &MF = getMachineFunction();
49374941 MachineMemOperand *MMO =
50595063 Flags |= MachineMemOperand::MONonTemporal;
50605064
50615065 if (PtrInfo.V.isNull())
5062 PtrInfo = InferPointerInfo(Ptr);
5066 PtrInfo = InferPointerInfo(*this, Ptr);
50635067
50645068 MachineFunction &MF = getMachineFunction();
50655069 MachineMemOperand *MMO =
51145118 Flags |= MachineMemOperand::MONonTemporal;
51155119
51165120 if (PtrInfo.V.isNull())
5117 PtrInfo = InferPointerInfo(Ptr);
5121 PtrInfo = InferPointerInfo(*this, Ptr);
51185122
51195123 MachineFunction &MF = getMachineFunction();
51205124 MachineMemOperand *MMO =
18091809 GuardPtr, MachinePointerInfo(IRGuard, 0),
18101810 true, false, false, Align);
18111811
1812 SDValue StackSlot = DAG.getLoad(PtrTy, dl, DAG.getEntryNode(),
1813 StackSlotPtr,
1814 MachinePointerInfo::getFixedStack(FI),
1815 true, false, false, Align);
1812 SDValue StackSlot = DAG.getLoad(
1813 PtrTy, dl, DAG.getEntryNode(), StackSlotPtr,
1814 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI), true,
1815 false, false, Align);
18161816
18171817 // Perform the comparison via a subtract/getsetcc.
18181818 EVT VT = Guard.getValueType();
47744774 SDValue FIN = DAG.getFrameIndex(FI, PtrTy);
47754775
47764776 // Store the stack protector onto the stack.
4777 Res = DAG.getStore(Chain, sdl, Src, FIN,
4778 MachinePointerInfo::getFixedStack(FI),
4777 Res = DAG.getStore(Chain, sdl, Src, FIN, MachinePointerInfo::getFixedStack(
4778 DAG.getMachineFunction(), FI),
47794779 true, false, 0);
47804780 setValue(&I, Res);
47814781 DAG.setRoot(Res);
60686068 int SSFI = MF.getFrameInfo()->CreateStackObject(TySize, Align, false);
60696069 SDValue StackSlot =
60706070 DAG.getFrameIndex(SSFI, TLI.getPointerTy(DAG.getDataLayout()));
6071 Chain = DAG.getStore(Chain, getCurSDLoc(),
6072 OpInfo.CallOperand, StackSlot,
6073 MachinePointerInfo::getFixedStack(SSFI),
6074 false, false, 0);
6071 Chain = DAG.getStore(
6072 Chain, getCurSDLoc(), OpInfo.CallOperand, StackSlot,
6073 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI),
6074 false, false, 0);
60756075 OpInfo.CallOperand = StackSlot;
60766076 }
60776077
70177017 PtrVT));
70187018 SDValue L = CLI.DAG.getLoad(
70197019 RetTys[i], CLI.DL, CLI.Chain, Add,
7020 MachinePointerInfo::getFixedStack(DemoteStackIdx, Offsets[i]), false,
7021 false, false, 1);
7020 MachinePointerInfo::getFixedStack(CLI.DAG.getMachineFunction(),
7021 DemoteStackIdx, Offsets[i]),
7022 false, false, false, 1);
70227023 ReturnValues[i] = L;
70237024 Chains[i] = L.getValue(1);
70247025 }
426426 // chaining stores one after another, this may allow
427427 // a bit more optimal scheduling for them
428428 Chain = Builder.DAG.getStore(Chain, Builder.getCurSDLoc(), Incoming, Loc,
429 MachinePointerInfo::getFixedStack(Index),
429 MachinePointerInfo::getFixedStack(
430 Builder.DAG.getMachineFunction(), Index),
430431 false, false, 0);
431432
432433 Builder.StatepointLowering.setLocation(Incoming, Loc);
882883 SDValue Chain = getRoot();
883884
884885 SDValue SpillLoad =
885 DAG.getLoad(SpillSlot.getValueType(), getCurSDLoc(), Chain, SpillSlot,
886 MachinePointerInfo::getFixedStack(*DerivedPtrLocation),
887 false, false, false, 0);
886 DAG.getLoad(SpillSlot.getValueType(), getCurSDLoc(), Chain, SpillSlot,
887 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(),
888 *DerivedPtrLocation),
889 false, false, false, 0);
888890
889891 // Again, be conservative, don't emit pending loads
890892 DAG.setRoot(SpillLoad.getValue(1));
317317 if (NewFI == -1 || (NewFI == (int)SS))
318318 continue;
319319
320 const PseudoSourceValue *NewSV = PseudoSourceValue::getFixedStack(NewFI);
320 const PseudoSourceValue *NewSV = MF.getPSVManager().getFixedStack(NewFI);
321321 SmallVectorImpl &RefMMOs = SSRefs[SS];
322322 for (unsigned i = 0, e = RefMMOs.size(); i != e; ++i)
323323 RefMMOs[i]->setValue(NewSV);
483483 "Folded a use to a non-load!");
484484 const MachineFrameInfo &MFI = *MF.getFrameInfo();
485485 assert(MFI.getObjectOffset(FI) != -1);
486 MachineMemOperand *MMO =
487 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
488 Flags, MFI.getObjectSize(FI),
489 MFI.getObjectAlignment(FI));
486 MachineMemOperand *MMO = MF.getMachineMemOperand(
487 MachinePointerInfo::getFixedStack(MF, FI), Flags, MFI.getObjectSize(FI),
488 MFI.getObjectAlignment(FI));
490489 NewMI->addMemOperand(MF, MMO);
491490
492491 return NewMI;
11511151 Flags |= MachineMemOperand::MOVolatile;
11521152 }
11531153 MachineMemOperand *MMO = MF.getMachineMemOperand(
1154 MachinePointerInfo::getFixedStack(FI), Flags,
1154 MachinePointerInfo::getFixedStack(MF, FI), Flags,
11551155 MF.getDataLayout().getPointerSize(), MFI.getObjectAlignment(FI));
11561156 MIB->addMemOperand(MF, MMO);
11571157
10571057 // FIXME: We shouldn't be using getObjectSize/getObjectAlignment. The size
10581058 // and alignment should be based on the VT.
10591059 MMO = FuncInfo.MF->getMachineMemOperand(
1060 MachinePointerInfo::getFixedStack(FI, Offset), Flags,
1061 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
1060 MachinePointerInfo::getFixedStack(*FuncInfo.MF, FI, Offset), Flags,
1061 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
10621062 // Now add the rest of the operands.
10631063 MIB.addFrameIndex(FI).addImm(Offset);
10641064 } else {
30203020
30213021 unsigned Alignment = DL.getABITypeAlignment(ArgVal->getType());
30223022 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
3023 MachinePointerInfo::getStack(Addr.getOffset()),
3024 MachineMemOperand::MOStore, ArgVT.getStoreSize(), Alignment);
3023 MachinePointerInfo::getStack(*FuncInfo.MF, Addr.getOffset()),
3024 MachineMemOperand::MOStore, ArgVT.getStoreSize(), Alignment);
30253025
30263026 if (!emitStore(ArgVT, ArgReg, Addr, MMO))
30273027 return false;
24612461 break;
24622462 }
24632463
2464 ArgValue = DAG.getExtLoad(ExtType, DL, VA.getLocVT(), Chain, FIN,
2465 MachinePointerInfo::getFixedStack(FI),
2466 MemVT, false, false, false, 0);
2464 ArgValue = DAG.getExtLoad(
2465 ExtType, DL, VA.getLocVT(), Chain, FIN,
2466 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
2467 MemVT, false, false, false, 0);
24672468
24682469 InVals.push_back(ArgValue);
24692470 }
25362537 for (unsigned i = FirstVariadicGPR; i < NumGPRArgRegs; ++i) {
25372538 unsigned VReg = MF.addLiveIn(GPRArgRegs[i], &AArch64::GPR64RegClass);
25382539 SDValue Val = DAG.getCopyFromReg(Chain, DL, VReg, MVT::i64);
2539 SDValue Store =
2540 DAG.getStore(Val.getValue(1), DL, Val, FIN,
2541 MachinePointerInfo::getStack(i * 8), false, false, 0);
2540 SDValue Store = DAG.getStore(
2541 Val.getValue(1), DL, Val, FIN,
2542 MachinePointerInfo::getStack(DAG.getMachineFunction(), i * 8), false,
2543 false, 0);
25422544 MemOps.push_back(Store);
25432545 FIN =
25442546 DAG.getNode(ISD::ADD, DL, PtrVT, FIN, DAG.getConstant(8, DL, PtrVT));
25652567 unsigned VReg = MF.addLiveIn(FPRArgRegs[i], &AArch64::FPR128RegClass);
25662568 SDValue Val = DAG.getCopyFromReg(Chain, DL, VReg, MVT::f128);
25672569
2568 SDValue Store =
2569 DAG.getStore(Val.getValue(1), DL, Val, FIN,
2570 MachinePointerInfo::getStack(i * 16), false, false, 0);
2570 SDValue Store = DAG.getStore(
2571 Val.getValue(1), DL, Val, FIN,
2572 MachinePointerInfo::getStack(DAG.getMachineFunction(), i * 16),
2573 false, false, 0);
25712574 MemOps.push_back(Store);
25722575 FIN = DAG.getNode(ISD::ADD, DL, PtrVT, FIN,
25732576 DAG.getConstant(16, DL, PtrVT));
30053008 int FI = MF.getFrameInfo()->CreateFixedObject(OpSize, Offset, true);
30063009
30073010 DstAddr = DAG.getFrameIndex(FI, PtrVT);
3008 DstInfo = MachinePointerInfo::getFixedStack(FI);
3011 DstInfo =
3012 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
30093013
30103014 // Make sure any stack arguments overlapping with where we're storing
30113015 // are loaded before this eventual operation. Otherwise they'll be
30153019 SDValue PtrOff = DAG.getIntPtrConstant(Offset, DL);
30163020
30173021 DstAddr = DAG.getNode(ISD::ADD, DL, PtrVT, StackPtr, PtrOff);
3018 DstInfo = MachinePointerInfo::getStack(LocMemOffset);
3022 DstInfo = MachinePointerInfo::getStack(DAG.getMachineFunction(),
3023 LocMemOffset);
30193024 }
30203025
30213026 if (Outs[i].Flags.isByVal()) {
32573262 unsigned char LoFlags = AArch64II::MO_PAGEOFF | AArch64II::MO_NC;
32583263 SDValue Lo = DAG.getTargetConstantPool(GV, PtrVT, 0, 0, LoFlags);
32593264 SDValue PoolAddr = DAG.getNode(AArch64ISD::ADDlow, DL, PtrVT, ADRP, Lo);
3260 SDValue GlobalAddr = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), PoolAddr,
3261 MachinePointerInfo::getConstantPool(),
3262 /*isVolatile=*/ false,
3263 /*isNonTemporal=*/ true,
3264 /*isInvariant=*/ true, 8);
3265 SDValue GlobalAddr = DAG.getLoad(
3266 PtrVT, DL, DAG.getEntryNode(), PoolAddr,
3267 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
3268 /*isVolatile=*/false,
3269 /*isNonTemporal=*/true,
3270 /*isInvariant=*/true, 8);
32653271 if (GN->getOffset() != 0)
32663272 return DAG.getNode(ISD::ADD, DL, PtrVT, GlobalAddr,
32673273 DAG.getConstant(GN->getOffset(), DL, PtrVT));
33343340 // to obtain the address of the variable.
33353341 SDValue Chain = DAG.getEntryNode();
33363342 SDValue FuncTLVGet =
3337 DAG.getLoad(MVT::i64, DL, Chain, DescAddr, MachinePointerInfo::getGOT(),
3338 false, true, true, 8);
3343 DAG.getLoad(MVT::i64, DL, Chain, DescAddr,
3344 MachinePointerInfo::getGOT(DAG.getMachineFunction()), false,
3345 true, true, 8);
33393346 Chain = FuncTLVGet.getValue(1);
33403347
33413348 MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
18471847 MachineFrameInfo &MFI = *MF.getFrameInfo();
18481848 unsigned Align = MFI.getObjectAlignment(FI);
18491849
1850 MachinePointerInfo PtrInfo(PseudoSourceValue::getFixedStack(FI));
1850 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(MF, FI);
18511851 MachineMemOperand *MMO = MF.getMachineMemOperand(
18521852 PtrInfo, MachineMemOperand::MOStore, MFI.getObjectSize(FI), Align);
18531853 unsigned Opc = 0;
19441944 MachineFunction &MF = *MBB.getParent();
19451945 MachineFrameInfo &MFI = *MF.getFrameInfo();
19461946 unsigned Align = MFI.getObjectAlignment(FI);
1947 MachinePointerInfo PtrInfo(PseudoSourceValue::getFixedStack(FI));
1947 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(MF, FI);
19481948 MachineMemOperand *MMO = MF.getMachineMemOperand(
19491949 PtrInfo, MachineMemOperand::MOLoad, MFI.getObjectSize(FI), Align);
19501950
690690 if (checkPrivateAddress(N->getMemOperand())) {
691691 if (MMO) {
692692 const PseudoSourceValue *PSV = MMO->getPseudoValue();
693 if (PSV && PSV == PseudoSourceValue::getConstantPool()) {
693 if (PSV && PSV->isConstantPool()) {
694694 return true;
695695 }
696696 }
852852 MachineFrameInfo &MFI = *MF.getFrameInfo();
853853 unsigned Align = MFI.getObjectAlignment(FI);
854854
855 MachineMemOperand *MMO =
856 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
857 MachineMemOperand::MOStore,
858 MFI.getObjectSize(FI),
859 Align);
855 MachineMemOperand *MMO = MF.getMachineMemOperand(
856 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOStore,
857 MFI.getObjectSize(FI), Align);
860858
861859 switch (RC->getSize()) {
862860 case 4:
10421040 MachineFunction &MF = *MBB.getParent();
10431041 MachineFrameInfo &MFI = *MF.getFrameInfo();
10441042 unsigned Align = MFI.getObjectAlignment(FI);
1045 MachineMemOperand *MMO =
1046 MF.getMachineMemOperand(
1047 MachinePointerInfo::getFixedStack(FI),
1048 MachineMemOperand::MOLoad,
1049 MFI.getObjectSize(FI),
1050 Align);
1043 MachineMemOperand *MMO = MF.getMachineMemOperand(
1044 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOLoad,
1045 MFI.getObjectSize(FI), Align);
10511046
10521047 switch (RC->getSize()) {
10531048 case 4:
40524047 MIB = BuildMI(MBB, MI, DL, get(LoadOpc), Reg);
40534048 MIB.addReg(Reg, RegState::Kill).addImm(0);
40544049 unsigned Flag = MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant;
4055 MachineMemOperand *MMO = MBB.getParent()->
4056 getMachineMemOperand(MachinePointerInfo::getGOT(), Flag, 4, 4);
4050 MachineMemOperand *MMO = MBB.getParent()->getMachineMemOperand(
4051 MachinePointerInfo::getGOT(*MBB.getParent()), Flag, 4, 4);
40574052 MIB.addMemOperand(MMO);
40584053 AddDefaultPred(MIB);
40594054 }
921921 if (Addr.BaseType == Address::FrameIndexBase) {
922922 int FI = Addr.Base.FI;
923923 int Offset = Addr.Offset;
924 MachineMemOperand *MMO =
925 FuncInfo.MF->getMachineMemOperand(
926 MachinePointerInfo::getFixedStack(FI, Offset),
927 Flags,
928 MFI.getObjectSize(FI),
929 MFI.getObjectAlignment(FI));
924 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
925 MachinePointerInfo::getFixedStack(*FuncInfo.MF, FI, Offset), Flags,
926 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
930927 // Now add the rest of the operands.
931928 MIB.addFrameIndex(FI);
932929
14721472 SDValue PtrOff = DAG.getIntPtrConstant(LocMemOffset, dl);
14731473 PtrOff = DAG.getNode(ISD::ADD, dl, getPointerTy(DAG.getDataLayout()),
14741474 StackPtr, PtrOff);
1475 return DAG.getStore(Chain, dl, Arg, PtrOff,
1476 MachinePointerInfo::getStack(LocMemOffset),
1477 false, false, 0);
1475 return DAG.getStore(
1476 Chain, dl, Arg, PtrOff,
1477 MachinePointerInfo::getStack(DAG.getMachineFunction(), LocMemOffset),
1478 false, false, 0);
14781479 }
14791480
14801481 void ARMTargetLowering::PassF64ArgInRegs(SDLoc dl, SelectionDAG &DAG,
17571758 // Get the address of the callee into a register
17581759 SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVt, 4);
17591760 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
1760 Callee = DAG.getLoad(PtrVt, dl, DAG.getEntryNode(), CPAddr,
1761 MachinePointerInfo::getConstantPool(), false, false,
1762 false, 0);
1761 Callee = DAG.getLoad(
1762 PtrVt, dl, DAG.getEntryNode(), CPAddr,
1763 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
1764 false, false, 0);
17631765 } else if (ExternalSymbolSDNode *S=dyn_cast(Callee)) {
17641766 const char *Sym = S->getSymbol();
17651767
17711773 // Get the address of the callee into a register
17721774 SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVt, 4);
17731775 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
1774 Callee = DAG.getLoad(PtrVt, dl, DAG.getEntryNode(), CPAddr,
1775 MachinePointerInfo::getConstantPool(), false, false,
1776 false, 0);
1776 Callee = DAG.getLoad(
1777 PtrVt, dl, DAG.getEntryNode(), CPAddr,
1778 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
1779 false, false, 0);
17771780 }
17781781 } else if (GlobalAddressSDNode *G = dyn_cast(Callee)) {
17791782 const GlobalValue *GV = G->getGlobal();
17911794 ARMISD::WrapperPIC, dl, PtrVt,
17921795 DAG.getTargetGlobalAddress(GV, dl, PtrVt, 0, ARMII::MO_NONLAZY));
17931796 Callee = DAG.getLoad(PtrVt, dl, DAG.getEntryNode(), Callee,
1794 MachinePointerInfo::getGOT(), false, false, true, 0);
1797 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
1798 false, false, true, 0);
17951799 } else if (Subtarget->isTargetCOFF()) {
17961800 assert(Subtarget->isTargetWindows() &&
17971801 "Windows is the only supported COFF target");
18041808 Callee =
18051809 DAG.getLoad(PtrVt, dl, DAG.getEntryNode(),
18061810 DAG.getNode(ARMISD::Wrapper, dl, PtrVt, Callee),
1807 MachinePointerInfo::getGOT(), false, false, false, 0);
1811 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
1812 false, false, false, 0);
18081813 } else {
18091814 // On ELF targets for PIC code, direct calls should go through the PLT
18101815 unsigned OpFlags = 0;
18271832 ARMPCLabelIndex, 4);
18281833 SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVt, 4);
18291834 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
1830 Callee = DAG.getLoad(PtrVt, dl, DAG.getEntryNode(), CPAddr,
1831 MachinePointerInfo::getConstantPool(), false, false,
1832 false, 0);
1835 Callee = DAG.getLoad(
1836 PtrVt, dl, DAG.getEntryNode(), CPAddr,
1837 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
1838 false, false, 0);
18331839 SDValue PICLabel = DAG.getConstant(ARMPCLabelIndex, dl, MVT::i32);
18341840 Callee = DAG.getNode(ARMISD::PIC_ADD, dl, PtrVt, Callee, PICLabel);
18351841 } else {
24892495 CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 4);
24902496 }
24912497 CPAddr = DAG.getNode(ARMISD::Wrapper, DL, PtrVT, CPAddr);
2492 SDValue Result = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), CPAddr,
2493 MachinePointerInfo::getConstantPool(),
2494 false, false, false, 0);
2498 SDValue Result =
2499 DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), CPAddr,
2500 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
2501 false, false, false, 0);
24952502 if (RelocM == Reloc::Static)
24962503 return Result;
24972504 SDValue PICLabel = DAG.getConstant(ARMPCLabelIndex, DL, MVT::i32);
25132520 ARMCP::CPValue, PCAdj, ARMCP::TLSGD, true);
25142521 SDValue Argument = DAG.getTargetConstantPool(CPV, PtrVT, 4);
25152522 Argument = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, Argument);
2516 Argument = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Argument,
2517 MachinePointerInfo::getConstantPool(),
2518 false, false, false, 0);
2523 Argument =
2524 DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Argument,
2525 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
2526 false, false, false, 0);
25192527 SDValue Chain = Argument.getValue(1);
25202528
25212529 SDValue PICLabel = DAG.getConstant(ARMPCLabelIndex, dl, MVT::i32);
25652573 true);
25662574 Offset = DAG.getTargetConstantPool(CPV, PtrVT, 4);
25672575 Offset = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, Offset);
2568 Offset = DAG.getLoad(PtrVT, dl, Chain, Offset,
2569 MachinePointerInfo::getConstantPool(),
2570 false, false, false, 0);
2576 Offset = DAG.getLoad(
2577 PtrVT, dl, Chain, Offset,
2578 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2579 false, false, 0);
25712580 Chain = Offset.getValue(1);
25722581
25732582 SDValue PICLabel = DAG.getConstant(ARMPCLabelIndex, dl, MVT::i32);
25742583 Offset = DAG.getNode(ARMISD::PIC_ADD, dl, PtrVT, Offset, PICLabel);
25752584
2576 Offset = DAG.getLoad(PtrVT, dl, Chain, Offset,
2577 MachinePointerInfo::getConstantPool(),
2578 false, false, false, 0);
2585 Offset = DAG.getLoad(
2586 PtrVT, dl, Chain, Offset,
2587 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2588 false, false, 0);
25792589 } else {
25802590 // local exec model
25812591 assert(model == TLSModel::LocalExec);
25832593 ARMConstantPoolConstant::Create(GV, ARMCP::TPOFF);
25842594 Offset = DAG.getTargetConstantPool(CPV, PtrVT, 4);
25852595 Offset = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, Offset);
2586 Offset = DAG.getLoad(PtrVT, dl, Chain, Offset,
2587 MachinePointerInfo::getConstantPool(),
2588 false, false, false, 0);
2596 Offset = DAG.getLoad(
2597 PtrVT, dl, Chain, Offset,
2598 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2599 false, false, 0);
25892600 }
25902601
25912602 // The address of the thread local variable is the add of the thread
26272638 UseGOTOFF ? ARMCP::GOTOFF : ARMCP::GOT);
26282639 SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 4);
26292640 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
2630 SDValue Result = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(),
2631 CPAddr,
2632 MachinePointerInfo::getConstantPool(),
2633 false, false, false, 0);
2641 SDValue Result = DAG.getLoad(
2642 PtrVT, dl, DAG.getEntryNode(), CPAddr,
2643 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2644 false, false, 0);
26342645 SDValue Chain = Result.getValue(1);
26352646 SDValue GOT = DAG.getGLOBAL_OFFSET_TABLE(PtrVT);
26362647 Result = DAG.getNode(ISD::ADD, dl, PtrVT, Result, GOT);
26372648 if (!UseGOTOFF)
26382649 Result = DAG.getLoad(PtrVT, dl, Chain, Result,
2639 MachinePointerInfo::getGOT(),
2650 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
26402651 false, false, false, 0);
26412652 return Result;
26422653 }
26522663 } else {
26532664 SDValue CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 4);
26542665 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
2655 return DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), CPAddr,
2656 MachinePointerInfo::getConstantPool(),
2657 false, false, false, 0);
2666 return DAG.getLoad(
2667 PtrVT, dl, DAG.getEntryNode(), CPAddr,
2668 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2669 false, false, 0);
26582670 }
26592671 }
26602672
26782690
26792691 if (Subtarget->GVIsIndirectSymbol(GV, RelocM))
26802692 Result = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Result,
2681 MachinePointerInfo::getGOT(), false, false, false, 0);
2693 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
2694 false, false, false, 0);
26822695 return Result;
26832696 }
26842697
27042717 TargetFlags));
27052718 if (GV->hasDLLImportStorageClass())
27062719 Result = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), Result,
2707 MachinePointerInfo::getGOT(), false, false, false, 0);
2720 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
2721 false, false, false, 0);
27082722 return Result;
27092723 }
27102724
27232737 ARMPCLabelIndex, PCAdj);
27242738 SDValue CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 4);
27252739 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
2726 SDValue Result = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), CPAddr,
2727 MachinePointerInfo::getConstantPool(),
2728 false, false, false, 0);
2740 SDValue Result =
2741 DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), CPAddr,
2742 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
2743 false, false, false, 0);
27292744 SDValue PICLabel = DAG.getConstant(ARMPCLabelIndex, dl, MVT::i32);
27302745 return DAG.getNode(ARMISD::PIC_ADD, dl, PtrVT, Result, PICLabel);
27312746 }
27832798 ARMCP::CPLSDA, PCAdj);
27842799 CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 4);
27852800 CPAddr = DAG.getNode(ARMISD::Wrapper, dl, MVT::i32, CPAddr);
2786 SDValue Result =
2787 DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), CPAddr,
2788 MachinePointerInfo::getConstantPool(),
2789 false, false, false, 0);
2801 SDValue Result = DAG.getLoad(
2802 PtrVT, dl, DAG.getEntryNode(), CPAddr,
2803 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2804 false, false, 0);
27902805
27912806 if (RelocM == Reloc::PIC_) {
27922807 SDValue PICLabel = DAG.getConstant(ARMPCLabelIndex, dl, MVT::i32);
29182933
29192934 // Create load node to retrieve arguments from the stack.
29202935 SDValue FIN = DAG.getFrameIndex(FI, getPointerTy(DAG.getDataLayout()));
2921 ArgValue2 = DAG.getLoad(MVT::i32, dl, Root, FIN,
2922 MachinePointerInfo::getFixedStack(FI),
2923 false, false, false, 0);
2936 ArgValue2 = DAG.getLoad(
2937 MVT::i32, dl, Root, FIN,
2938 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI), false,
2939 false, false, 0);
29242940 } else {
29252941 Reg = MF.addLiveIn(NextVA.getLocReg(), RC);
29262942 ArgValue2 = DAG.getCopyFromReg(Root, dl, Reg, MVT::i32);
31043120 if (VA.isMemLoc()) {
31053121 int FI = MFI->CreateFixedObject(8, VA.getLocMemOffset(), true);
31063122 SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
3107 ArgValue2 = DAG.getLoad(MVT::f64, dl, Chain, FIN,
3108 MachinePointerInfo::getFixedStack(FI),
3109 false, false, false, 0);
3123 ArgValue2 = DAG.getLoad(
3124 MVT::f64, dl, Chain, FIN,
3125 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
3126 false, false, false, 0);
31103127 } else {
31113128 ArgValue2 = GetF64FormalArgument(VA, ArgLocs[++i],
31123129 Chain, DAG, dl);
31993216
32003217 // Create load nodes to retrieve arguments from the stack.
32013218 SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
3202 InVals.push_back(DAG.getLoad(VA.getValVT(), dl, Chain, FIN,
3203 MachinePointerInfo::getFixedStack(FI),
3204 false, false, false, 0));
3219 InVals.push_back(DAG.getLoad(
3220 VA.getValVT(), dl, Chain, FIN,
3221 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
3222 false, false, false, 0));
32053223 }
32063224 lastInsIndex = index;
32073225 }
39383956 Addr, Op.getOperand(2), JTI);
39393957 }
39403958 if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
3941 Addr = DAG.getLoad((EVT)MVT::i32, dl, Chain, Addr,
3942 MachinePointerInfo::getJumpTable(),
3943 false, false, false, 0);
3959 Addr =
3960 DAG.getLoad((EVT)MVT::i32, dl, Chain, Addr,
3961 MachinePointerInfo::getJumpTable(DAG.getMachineFunction()),
3962 false, false, false, 0);
39443963 Chain = Addr.getValue(1);
39453964 Addr = DAG.getNode(ISD::ADD, dl, PTy, Addr, Table);
39463965 return DAG.getNode(ARMISD::BR_JT, dl, MVT::Other, Chain, Addr, JTI);
39473966 } else {
3948 Addr = DAG.getLoad(PTy, dl, Chain, Addr,
3949 MachinePointerInfo::getJumpTable(),
3950 false, false, false, 0);
3967 Addr =
3968 DAG.getLoad(PTy, dl, Chain, Addr,
3969 MachinePointerInfo::getJumpTable(DAG.getMachineFunction()),
3970 false, false, false, 0);
39513971 Chain = Addr.getValue(1);
39523972 return DAG.getNode(ARMISD::BR_JT, dl, MVT::Other, Chain, Addr, JTI);
39533973 }
68796899
68806900 // Grab constant pool and fixed stack memory operands.
68816901 MachineMemOperand *CPMMO =
6882 MF->getMachineMemOperand(MachinePointerInfo::getConstantPool(),
6883 MachineMemOperand::MOLoad, 4, 4);
6902 MF->getMachineMemOperand(MachinePointerInfo::getConstantPool(*MF),
6903 MachineMemOperand::MOLoad, 4, 4);
68846904
68856905 MachineMemOperand *FIMMOSt =
6886 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
6887 MachineMemOperand::MOStore, 4, 4);
6906 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(*MF, FI),
6907 MachineMemOperand::MOStore, 4, 4);
68886908
68896909 // Load the address of the dispatch MBB into the jump buffer.
68906910 if (isThumb2) {
70607080 // context.
70617081 SetupEntryBlockForSjLj(MI, MBB, DispatchBB, FI);
70627082
7063 MachineMemOperand *FIMMOLd =
7064 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
7065 MachineMemOperand::MOLoad |
7066 MachineMemOperand::MOVolatile, 4, 4);
7083 MachineMemOperand *FIMMOLd = MF->getMachineMemOperand(
7084 MachinePointerInfo::getFixedStack(*MF, FI),
7085 MachineMemOperand::MOLoad | MachineMemOperand::MOVolatile, 4, 4);
70677086
70687087 MachineInstrBuilder MIB;
70697088 MIB = BuildMI(DispatchBB, dl, TII->get(ARM::Int_eh_sjlj_dispatchsetup));
71787197 .addReg(NewVReg2, RegState::Kill)
71797198 .addReg(NewVReg3));
71807199
7181 MachineMemOperand *JTMMOLd =
7182 MF->getMachineMemOperand(MachinePointerInfo::getJumpTable(),
7183 MachineMemOperand::MOLoad, 4, 4);
7200 MachineMemOperand *JTMMOLd = MF->getMachineMemOperand(
7201 MachinePointerInfo::getJumpTable(*MF), MachineMemOperand::MOLoad, 4, 4);
71847202
71857203 unsigned NewVReg5 = MRI->createVirtualRegister(TRC);
71867204 AddDefaultPred(BuildMI(DispContBB, dl, TII->get(ARM::tLDRi), NewVReg5)
72627280 AddDefaultPred(BuildMI(DispContBB, dl, TII->get(ARM::LEApcrelJT), NewVReg4)
72637281 .addJumpTableIndex(MJTI));
72647282
7265 MachineMemOperand *JTMMOLd =
7266 MF->getMachineMemOperand(MachinePointerInfo::getJumpTable(),
7267 MachineMemOperand::MOLoad, 4, 4);
7283 MachineMemOperand *JTMMOLd = MF->getMachineMemOperand(
7284 MachinePointerInfo::getJumpTable(*MF), MachineMemOperand::MOLoad, 4, 4);
72687285 unsigned NewVReg5 = MRI->createVirtualRegister(TRC);
72697286 AddDefaultPred(
72707287 BuildMI(DispContBB, dl, TII->get(ARM::LDRrs), NewVReg5)
123123 .addGlobalAddress(GV, 0, ARMII::MO_NONLAZY);
124124 unsigned Flag = MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant;
125125 MachineMemOperand *MMO = MBB.getParent()->getMachineMemOperand(
126 MachinePointerInfo::getGOT(), Flag, 4, 4);
126 MachinePointerInfo::getGOT(*MBB.getParent()), Flag, 4, 4);
127127 MIB.addMemOperand(MMO);
128128 MIB = BuildMI(MBB, MI, DL, get(ARM::LDRi12), Reg);
129129 MIB.addReg(Reg, RegState::Kill).addImm(0);
8383
8484 MachineFunction &MF = *MBB.getParent();
8585 MachineFrameInfo &MFI = *MF.getFrameInfo();
86 MachineMemOperand *MMO =
87 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
88 MachineMemOperand::MOStore,
89 MFI.getObjectSize(FI),
90 MFI.getObjectAlignment(FI));
86 MachineMemOperand *MMO = MF.getMachineMemOperand(
87 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOStore,
88 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
9189 AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::tSTRspi))
9290 .addReg(SrcReg, getKillRegState(isKill))
9391 .addFrameIndex(FI).addImm(0).addMemOperand(MMO));
111109
112110 MachineFunction &MF = *MBB.getParent();
113111 MachineFrameInfo &MFI = *MF.getFrameInfo();
114 MachineMemOperand *MMO =
115 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
116 MachineMemOperand::MOLoad,
117 MFI.getObjectSize(FI),
118 MFI.getObjectAlignment(FI));
112 MachineMemOperand *MMO = MF.getMachineMemOperand(
113 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOLoad,
114 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
119115 AddDefaultPred(BuildMI(MBB, I, DL, get(ARM::tLDRspi), DestReg)
120116 .addFrameIndex(FI).addImm(0).addMemOperand(MMO));
121117 }
130130
131131 MachineFunction &MF = *MBB.getParent();
132132 MachineFrameInfo &MFI = *MF.getFrameInfo();
133 MachineMemOperand *MMO =
134 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
135 MachineMemOperand::MOStore,
136 MFI.getObjectSize(FI),
137 MFI.getObjectAlignment(FI));
133 MachineMemOperand *MMO = MF.getMachineMemOperand(
134 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOStore,
135 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
138136
139137 if (RC == &ARM::GPRRegClass || RC == &ARM::tGPRRegClass ||
140138 RC == &ARM::tcGPRRegClass || RC == &ARM::rGPRRegClass ||
170168 const TargetRegisterInfo *TRI) const {
171169 MachineFunction &MF = *MBB.getParent();
172170 MachineFrameInfo &MFI = *MF.getFrameInfo();
173 MachineMemOperand *MMO =
174 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
175 MachineMemOperand::MOLoad,
176 MFI.getObjectSize(FI),
177 MFI.getObjectAlignment(FI));
171 MachineMemOperand *MMO = MF.getMachineMemOperand(
172 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOLoad,
173 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
178174 DebugLoc DL;
179175 if (I != MBB.end()) DL = I->getDebugLoc();
180176
554554 MemOpChains.push_back(CreateCopyOfByValArgument(Arg, MemAddr, Chain,
555555 Flags, DAG, dl));
556556 } else {
557 MachinePointerInfo LocPI = MachinePointerInfo::getStack(LocMemOffset);
557 MachinePointerInfo LocPI = MachinePointerInfo::getStack(
558 DAG.getMachineFunction(), LocMemOffset);
558559 SDValue S = DAG.getStore(Chain, dl, Arg, MemAddr, LocPI, false,
559560 false, 0);
560561 MemOpChains.push_back(S);
614614 MachineFrameInfo &MFI = *MF.getFrameInfo();
615615 unsigned Align = MFI.getObjectAlignment(FI);
616616
617 MachineMemOperand *MMO =
618 MF.getMachineMemOperand(
619 MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)),
620 MachineMemOperand::MOStore,
621 MFI.getObjectSize(FI),
622 Align);
617 MachineMemOperand *MMO = MF.getMachineMemOperand(
618 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOStore,
619 MFI.getObjectSize(FI), Align);
623620
624621 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
625622 BuildMI(MBB, I, DL, get(Hexagon::S2_storeri_io))
660657 MachineFrameInfo &MFI = *MF.getFrameInfo();
661658 unsigned Align = MFI.getObjectAlignment(FI);
662659
663 MachineMemOperand *MMO =
664 MF.getMachineMemOperand(
665 MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)),
666 MachineMemOperand::MOLoad,
667 MFI.getObjectSize(FI),
668 Align);
660 MachineMemOperand *MMO = MF.getMachineMemOperand(
661 MachinePointerInfo::getFixedStack(MF, FI), MachineMemOperand::MOLoad,
662 MFI.getObjectSize(FI), Align);
669663 if (RC == &Hexagon::IntRegsRegClass) {
670664 BuildMI(MBB, I, DL, get(Hexagon::L2_loadri_io), DestReg)
671665 .addFrameIndex(FI).addImm(0).addMemOperand(MMO);
507507 // Create the SelectionDAG nodes corresponding to a load
508508 //from this parameter
509509 SDValue FIN = DAG.getFrameIndex(FI, MVT::i16);
510 InVal = DAG.getLoad(VA.getLocVT(), dl, Chain, FIN,
511 MachinePointerInfo::getFixedStack(FI),
512 false, false, false, 0);
510 InVal = DAG.getLoad(
511 VA.getLocVT(), dl, Chain, FIN,
512 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
513 false, false, false, 0);
513514 }
514515
515516 InVals.push_back(InVal);
4343 MachineFunction &MF = *MBB.getParent();
4444 MachineFrameInfo &MFI = *MF.getFrameInfo();
4545
46 MachineMemOperand *MMO =
47 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx),
48 MachineMemOperand::MOStore,
49 MFI.getObjectSize(FrameIdx),
50 MFI.getObjectAlignment(FrameIdx));
46 MachineMemOperand *MMO = MF.getMachineMemOperand(
47 MachinePointerInfo::getFixedStack(MF, FrameIdx),
48 MachineMemOperand::MOStore, MFI.getObjectSize(FrameIdx),
49 MFI.getObjectAlignment(FrameIdx));
5150
5251 if (RC == &MSP430::GR16RegClass)
5352 BuildMI(MBB, MI, DL, get(MSP430::MOV16mr))
7170 MachineFunction &MF = *MBB.getParent();
7271 MachineFrameInfo &MFI = *MF.getFrameInfo();
7372
74 MachineMemOperand *MMO =
75 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx),
76 MachineMemOperand::MOLoad,
77 MFI.getObjectSize(FrameIdx),
78 MFI.getObjectAlignment(FrameIdx));
73 MachineMemOperand *MMO = MF.getMachineMemOperand(
74 MachinePointerInfo::getFixedStack(MF, FrameIdx),
75 MachineMemOperand::MOLoad, MFI.getObjectSize(FrameIdx),
76 MFI.getObjectAlignment(FrameIdx));
7977
8078 if (RC == &MSP430::GR16RegClass)
8179 BuildMI(MBB, MI, DL, get(MSP430::MOV16rm))
430430 (*MI.memoperands_begin())->getPseudoValue()) {
431431 if (isa(PSV))
432432 return false;
433 return !PSV->isConstant(nullptr) && PSV != PseudoSourceValue::getStack();
433 return !PSV->isConstant(nullptr) && !PSV->isStack();
434434 }
435435
436436 return true;
746746 unsigned Offset = Addr.getOffset();
747747 MachineFrameInfo &MFI = *MF->getFrameInfo();
748748 MachineMemOperand *MMO = MF->getMachineMemOperand(
749 MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOLoad,
749 MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOLoad,
750750 MFI.getObjectSize(FI), Align);
751751 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ResultReg)
752752 .addFrameIndex(FI)
797797 unsigned Offset = Addr.getOffset();
798798 MachineFrameInfo &MFI = *MF->getFrameInfo();
799799 MachineMemOperand *MMO = MF->getMachineMemOperand(
800 MachinePointerInfo::getFixedStack(FI), MachineMemOperand::MOLoad,
800 MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOLoad,
801801 MFI.getObjectSize(FI), Align);
802802 BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc))
803803 .addReg(SrcReg)
11951195
11961196 unsigned Alignment = DL.getABITypeAlignment(ArgVal->getType());
11971197 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
1198 MachinePointerInfo::getStack(Addr.getOffset()),
1198 MachinePointerInfo::getStack(*FuncInfo.MF, Addr.getOffset()),
11991199 MachineMemOperand::MOStore, ArgVT.getStoreSize(), Alignment);
12001200 (void)(MMO);
12011201 // if (!emitStore(ArgVT, ArgReg, Addr, MMO))
15851585 SDValue Addr = DAG.getNode(ISD::ADD, DL, PTy, Index, Table);
15861586
15871587 EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), EntrySize * 8);
1588 Addr = DAG.getExtLoad(ISD::SEXTLOAD, DL, PTy, Chain, Addr,
1589 MachinePointerInfo::getJumpTable(), MemVT, false, false,
1590 false, 0);
1588 Addr =
1589 DAG.getExtLoad(ISD::SEXTLOAD, DL, PTy, Chain, Addr,
1590 MachinePointerInfo::getJumpTable(DAG.getMachineFunction()),
1591 MemVT, false, false, false, 0);
15911592 Chain = Addr.getValue(1);
15921593
15931594 if ((getTargetMachine().getRelocationModel() == Reloc::PIC_) || ABI.IsN64()) {
16891690 return getAddrLocal(N, SDLoc(N), Ty, DAG, ABI.IsN32() || ABI.IsN64());
16901691
16911692 if (LargeGOT)
1692 return getAddrGlobalLargeGOT(N, SDLoc(N), Ty, DAG, MipsII::MO_GOT_HI16,
1693 MipsII::MO_GOT_LO16, DAG.getEntryNode(),
1694 MachinePointerInfo::getGOT());
1695
1696 return getAddrGlobal(N, SDLoc(N), Ty, DAG,
1697 (ABI.IsN32() || ABI.IsN64()) ? MipsII::MO_GOT_DISP
1698 : MipsII::MO_GOT16,
1699 DAG.getEntryNode(), MachinePointerInfo::getGOT());
1693 return getAddrGlobalLargeGOT(
1694 N, SDLoc(N), Ty, DAG, MipsII::MO_GOT_HI16, MipsII::MO_GOT_LO16,
1695 DAG.getEntryNode(),
1696 MachinePointerInfo::getGOT(DAG.getMachineFunction()));
1697
1698 return getAddrGlobal(
1699 N, SDLoc(N), Ty, DAG,
1700 (ABI.IsN32() || ABI.IsN64()) ? MipsII::MO_GOT_DISP : MipsII::MO_GOT16,
1701 DAG.getEntryNode(), MachinePointerInfo::getGOT(DAG.getMachineFunction()));
17001702 }
17011703
17021704 SDValue MipsTargetLowering::lowerBlockAddress(SDValue Op,
30363038
30373039 // Create load nodes to retrieve arguments from the stack
30383040 SDValue FIN = DAG.getFrameIndex(FI, getPointerTy(DAG.getDataLayout()));
3039 SDValue ArgValue = DAG.getLoad(LocVT, DL, Chain, FIN,
3040 MachinePointerInfo::getFixedStack(FI),
3041 false, false, false, 0);
3041 SDValue ArgValue = DAG.getLoad(
3042 LocVT, DL, Chain, FIN,
3043 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
3044 false, false, false, 0);
30423045 OutChains.push_back(ArgValue.getValue(1));
30433046
30443047 ArgValue = UnpackFromArgumentSlot(ArgValue, VA, Ins[i].ArgVT, DL, DAG);
281281 unsigned GOTFlag = IsN32OrN64 ? MipsII::MO_GOT_PAGE : MipsII::MO_GOT;
282282 SDValue GOT = DAG.getNode(MipsISD::Wrapper, DL, Ty, getGlobalReg(DAG, Ty),
283283 getTargetNode(N, Ty, DAG, GOTFlag));
284 SDValue Load = DAG.getLoad(Ty, DL, DAG.getEntryNode(), GOT,
285 MachinePointerInfo::getGOT(), false, false,
286 false, 0);
284 SDValue Load =
285 DAG.getLoad(Ty, DL, DAG.getEntryNode(), GOT,
286 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
287 false, false, false, 0);
287288 unsigned LoFlag = IsN32OrN64 ? MipsII::MO_GOT_OFST : MipsII::MO_ABS_LO;
288289 SDValue Lo = DAG.getNode(MipsISD::Lo, DL, Ty,
289290 getTargetNode(N, Ty, DAG, LoFlag));
5959 MachineFrameInfo &MFI = *MF.getFrameInfo();
6060 unsigned Align = MFI.getObjectAlignment(FI);
6161
62 return MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI), Flag,
63 MFI.getObjectSize(FI), Align);
62 return MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(MF, FI),
63 Flag, MFI.getObjectSize(FI), Align);
6464 }
6565
6666 //===----------------------------------------------------------------------===//
527527 // VSX only provides an indexed load.
528528 if (Is32VSXLoad || Is64VSXLoad) return false;
529529
530 MachineMemOperand *MMO =
531 FuncInfo.MF->getMachineMemOperand(
532 MachinePointerInfo::getFixedStack(Addr.Base.FI, Addr.Offset),
530 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
531 MachinePointerInfo::getFixedStack(*FuncInfo.MF, Addr.Base.FI,
532 Addr.Offset),
533533 MachineMemOperand::MOLoad, MFI.getObjectSize(Addr.Base.FI),
534534 MFI.getObjectAlignment(Addr.Base.FI));
535535
660660 // VSX only provides an indexed store.
661661 if (Is32VSXStore || Is64VSXStore) return false;
662662
663 MachineMemOperand *MMO =
664 FuncInfo.MF->getMachineMemOperand(
665 MachinePointerInfo::getFixedStack(Addr.Base.FI, Addr.Offset),
663 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
664 MachinePointerInfo::getFixedStack(*FuncInfo.MF, Addr.Base.FI,
665 Addr.Offset),
666666 MachineMemOperand::MOStore, MFI.getObjectSize(Addr.Base.FI),
667667 MFI.getObjectAlignment(Addr.Base.FI));
668668
18951895 unsigned DestReg = createResultReg(TLI.getRegClassFor(VT));
18961896 CodeModel::Model CModel = TM.getCodeModel();
18971897
1898 MachineMemOperand *MMO =
1899 FuncInfo.MF->getMachineMemOperand(
1900 MachinePointerInfo::getConstantPool(), MachineMemOperand::MOLoad,
1901 (VT == MVT::f32) ? 4 : 8, Align);
1898 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
1899 MachinePointerInfo::getConstantPool(*FuncInfo.MF),
1900 MachineMemOperand::MOLoad, (VT == MVT::f32) ? 4 : 8, Align);
19021901
19031902 unsigned Opc = (VT == MVT::f32) ? PPC::LFS : PPC::LFD;
19041903 unsigned TmpReg = createResultReg(&PPC::G8RC_and_G8RC_NOX0RegClass);
19951995 DAG.getNode(PPCISD::GlobalBaseReg, dl, VT);
19961996
19971997 SDValue Ops[] = { GA, Reg };
1998 return DAG.getMemIntrinsicNode(PPCISD::TOC_ENTRY, dl,
1999 DAG.getVTList(VT, MVT::Other), Ops, VT,
2000 MachinePointerInfo::getGOT(), 0, false, true,
2001 false, 0);
1998 return DAG.getMemIntrinsicNode(
1999 PPCISD::TOC_ENTRY, dl, DAG.getVTList(VT, MVT::Other), Ops, VT,
2000 MachinePointerInfo::getGOT(DAG.getMachineFunction()), 0, false, true,
2001 false, 0);
20022002 }
20032003
20042004 SDValue PPCTargetLowering::LowerConstantPool(SDValue Op,
38953895 SDValue FIN = TailCallArgs[i].FrameIdxOp;
38963896 int FI = TailCallArgs[i].FrameIdx;
38973897 // Store relative to framepointer.
3898 MemOpChains.push_back(DAG.getStore(Chain, dl, Arg, FIN,
3899 MachinePointerInfo::getFixedStack(FI),
3900 false, false, 0));
3898 MemOpChains.push_back(DAG.getStore(
3899 Chain, dl, Arg, FIN,
3900 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI), false,
3901 false, 0));
39013902 }
39023903 }
39033904
39223923 NewRetAddrLoc, true);
39233924 EVT VT = isPPC64 ? MVT::i64 : MVT::i32;
39243925 SDValue NewRetAddrFrIdx = DAG.getFrameIndex(NewRetAddr, VT);
3925 Chain = DAG.getStore(Chain, dl, OldRetAddr, NewRetAddrFrIdx,
3926 MachinePointerInfo::getFixedStack(NewRetAddr),
3927 false, false, 0);
3926 Chain = DAG.getStore(
3927 Chain, dl, OldRetAddr, NewRetAddrFrIdx,
3928 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), NewRetAddr),
3929 false, false, 0);
39283930
39293931 // When using the 32/64-bit SVR4 ABI there is no need to move the FP stack
39303932 // slot as the FP is never overwritten.
39333935 int NewFPIdx = MF.getFrameInfo()->CreateFixedObject(SlotSize, NewFPLoc,
39343936 true);
39353937 SDValue NewFramePtrIdx = DAG.getFrameIndex(NewFPIdx, VT);
3936 Chain = DAG.getStore(Chain, dl, OldFP, NewFramePtrIdx,
3937 MachinePointerInfo::getFixedStack(NewFPIdx),
3938 false, false, 0);
3938 Chain = DAG.getStore(
3939 Chain, dl, OldFP, NewFramePtrIdx,
3940 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), NewFPIdx),
3941 false, false, 0);
39393942 }
39403943 }
39413944 return Chain;
53185321 unsigned TOCSaveOffset = Subtarget.getFrameLowering()->getTOCSaveOffset();
53195322 SDValue PtrOff = DAG.getIntPtrConstant(TOCSaveOffset, dl);
53205323 SDValue AddPtr = DAG.getNode(ISD::ADD, dl, PtrVT, StackPtr, PtrOff);
5321 Chain = DAG.getStore(Val.getValue(1), dl, Val, AddPtr,
5322 MachinePointerInfo::getStack(TOCSaveOffset),
5323 false, false, 0);
5324 Chain = DAG.getStore(
5325 Val.getValue(1), dl, Val, AddPtr,
5326 MachinePointerInfo::getStack(DAG.getMachineFunction(), TOCSaveOffset),
5327 false, false, 0);
53245328 // In the ELFv2 ABI, R12 must contain the address of an indirect callee.
53255329 // This does not mean the MTCTR instruction must use R12; it's easier
53265330 // to model this as an extra parameter, so do that.
61016105 (Op.getOpcode() == ISD::FP_TO_SINT || Subtarget.hasFPCVT());
61026106 SDValue FIPtr = DAG.CreateStackTemporary(i32Stack ? MVT::i32 : MVT::f64);
61036107 int FI = cast(FIPtr)->getIndex();
6104 MachinePointerInfo MPI = MachinePointerInfo::getFixedStack(FI);
6108 MachinePointerInfo MPI =
6109 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI);
61056110
61066111 // Emit a store to the stack slot.
61076112 SDValue Chain;
64216426 int FrameIdx = FrameInfo->CreateStackObject(4, 4, false);
64226427 SDValue FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
64236428
6424 SDValue Store =
6425 DAG.getStore(DAG.getEntryNode(), dl, SINT.getOperand(0), FIdx,
6426 MachinePointerInfo::getFixedStack(FrameIdx),
6427 false, false, 0);
6429 SDValue Store = DAG.getStore(
6430 DAG.getEntryNode(), dl, SINT.getOperand(0), FIdx,
6431 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx),
6432 false, false, 0);
64286433
64296434 assert(cast(Store)->getMemoryVT() == MVT::i32 &&
64306435 "Expected an i32 store");
64316436
64326437 RLI.Ptr = FIdx;
64336438 RLI.Chain = Store;
6434 RLI.MPI = MachinePointerInfo::getFixedStack(FrameIdx);
6439 RLI.MPI =
6440 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx);
64356441 RLI.Alignment = 4;
64366442
64376443 MachineMemOperand *MMO =
64726478 int FrameIdx = FrameInfo->CreateStackObject(4, 4, false);
64736479 SDValue FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
64746480
6475 SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Op.getOperand(0), FIdx,
6476 MachinePointerInfo::getFixedStack(FrameIdx),
6477 false, false, 0);
6481 SDValue Store = DAG.getStore(
6482 DAG.getEntryNode(), dl, Op.getOperand(0), FIdx,
6483 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx),
6484 false, false, 0);
64786485
64796486 assert(cast(Store)->getMemoryVT() == MVT::i32 &&
64806487 "Expected an i32 store");
64816488
64826489 RLI.Ptr = FIdx;
64836490 RLI.Chain = Store;
6484 RLI.MPI = MachinePointerInfo::getFixedStack(FrameIdx);
6491 RLI.MPI =
6492 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx);
64856493 RLI.Alignment = 4;
64866494 }
64876495
65066514 Op.getOperand(0));
65076515
65086516 // STD the extended value into the stack slot.
6509 SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, Ext64, FIdx,
6510 MachinePointerInfo::getFixedStack(FrameIdx),
6511 false, false, 0);
6517 SDValue Store = DAG.getStore(
6518 DAG.getEntryNode(), dl, Ext64, FIdx,
6519 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx),
6520 false, false, 0);
65126521
65136522 // Load the value as a double.
6514 Ld = DAG.getLoad(MVT::f64, dl, Store, FIdx,
6515 MachinePointerInfo::getFixedStack(FrameIdx),
6516 false, false, false, 0);
6523 Ld = DAG.getLoad(
6524 MVT::f64, dl, Store, FIdx,
6525 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx),
6526 false, false, false, 0);
65176527 }
65186528
65196529 // FCFID it and return it.
67686778 // to a zero vector to get the boolean result.
67696779 MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo();
67706780 int FrameIdx = FrameInfo->CreateStackObject(16, 16, false);
6771 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(FrameIdx);
6781 MachinePointerInfo PtrInfo =
6782 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx);
67726783 EVT PtrVT = getPointerTy(DAG.getDataLayout());
67736784 SDValue FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
67746785
68146825 ValueVTs.push_back(MVT::Other); // chain
68156826 SDVTList VTs = DAG.getVTList(ValueVTs);
68166827
6817 return DAG.getMemIntrinsicNode(PPCISD::QVLFSb,
6818 dl, VTs, Ops, MVT::v4f32,
6819 MachinePointerInfo::getConstantPool());
6828 return DAG.getMemIntrinsicNode(
6829 PPCISD::QVLFSb, dl, VTs, Ops, MVT::v4f32,
6830 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()));
68206831 }
68216832
68226833 SmallVector Stores;
75437554
75447555 MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo();
75457556 int FrameIdx = FrameInfo->CreateStackObject(16, 16, false);
7546 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(FrameIdx);
7557 MachinePointerInfo PtrInfo =
7558 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx);
75477559 EVT PtrVT = getPointerTy(DAG.getDataLayout());
75487560 SDValue FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
75497561
77597771
77607772 MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo();
77617773 int FrameIdx = FrameInfo->CreateStackObject(16, 16, false);
7762 MachinePointerInfo PtrInfo = MachinePointerInfo::getFixedStack(FrameIdx);
7774 MachinePointerInfo PtrInfo =
7775 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FrameIdx);
77637776 EVT PtrVT = getPointerTy(DAG.getDataLayout());
77647777 SDValue FIdx = DAG.getFrameIndex(FrameIdx, PtrVT);
77657778
12521252 MBB.insert(MI, NewMIs[i]);
12531253
12541254 const MachineFrameInfo &MFI = *MF.getFrameInfo();
1255 MachineMemOperand *MMO =
1256 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx),
1257 MachineMemOperand::MOStore,
1258 MFI.getObjectSize(FrameIdx),
1259 MFI.getObjectAlignment(FrameIdx));
1255 MachineMemOperand *MMO = MF.getMachineMemOperand(
1256 MachinePointerInfo::getFixedStack(MF, FrameIdx),
1257 MachineMemOperand::MOStore, MFI.getObjectSize(FrameIdx),
1258 MFI.getObjectAlignment(FrameIdx));
12601259 NewMIs.back()->addMemOperand(MF, MMO);
12611260 }
12621261
13651364 MBB.insert(MI, NewMIs[i]);
13661365
13671366 const MachineFrameInfo &MFI = *MF.getFrameInfo();
1368 MachineMemOperand *MMO =
1369 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIdx),
1370 MachineMemOperand::MOLoad,
1371 MFI.getObjectSize(FrameIdx),
1372 MFI.getObjectAlignment(FrameIdx));
1367 MachineMemOperand *MMO = MF.getMachineMemOperand(
1368 MachinePointerInfo::getFixedStack(MF, FrameIdx),
1369 MachineMemOperand::MOLoad, MFI.getObjectSize(FrameIdx),
1370 MFI.getObjectAlignment(FrameIdx));
13731371 NewMIs.back()->addMemOperand(MF, MMO);
13741372 }
13751373
657657 InVals.push_back(DAG.getLoad(
658658 VA.getValVT(), DL, Chain,
659659 DAG.getFrameIndex(FI, getPointerTy(MF.getDataLayout())),
660 MachinePointerInfo::getFixedStack(FI), false, false, false, 0));
660 MachinePointerInfo::getFixedStack(MF, FI), false, false, false, 0));
661661 }
662662
663663 if (!IsVarArg)
685685 SDValue VArg = DAG.getCopyFromReg(Chain, DL, VReg, MVT::i64);
686686 int FI = MF.getFrameInfo()->CreateFixedObject(8, ArgOffset + ArgArea, true);
687687 auto PtrVT = getPointerTy(MF.getDataLayout());
688 OutChains.push_back(
689 DAG.getStore(Chain, DL, VArg, DAG.getFrameIndex(FI, PtrVT),
690 MachinePointerInfo::getFixedStack(FI), false, false, 0));
688 OutChains.push_back(DAG.getStore(
689 Chain, DL, VArg, DAG.getFrameIndex(FI, PtrVT),
690 MachinePointerInfo::getFixedStack(MF, FI), false, false, 0));
691691 }
692692
693693 if (!OutChains.empty())
19081908 MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
19091909 MFI->setHasCalls(true);
19101910 return DAG.getLoad(VT, DL, DAG.getEntryNode(), AbsAddr,
1911 MachinePointerInfo::getGOT(), false, false, false, 0);
1911 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
1912 false, false, false, 0);
19121913 }
19131914
19141915 // This is one of the absolute code models.
375375
376376 MachineFunction *MF = MBB.getParent();
377377 const MachineFrameInfo &MFI = *MF->getFrameInfo();
378 MachineMemOperand *MMO =
379 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
380 MachineMemOperand::MOStore,
381 MFI.getObjectSize(FI),
382 MFI.getObjectAlignment(FI));
378 MachineMemOperand *MMO = MF->getMachineMemOperand(
379 MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOStore,
380 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
383381
384382 // On the order of operands here: think "[FrameIdx + 0] = SrcReg".
385383 if (RC == &SP::I64RegsRegClass)
416414
417415 MachineFunction *MF = MBB.getParent();
418416 const MachineFrameInfo &MFI = *MF->getFrameInfo();
419 MachineMemOperand *MMO =
420 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FI),
421 MachineMemOperand::MOLoad,
422 MFI.getObjectSize(FI),
423 MFI.getObjectAlignment(FI));
417 MachineMemOperand *MMO = MF->getMachineMemOperand(
418 MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOLoad,
419 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
424420
425421 if (RC == &SP::I64RegsRegClass)
426422 BuildMI(MBB, I, DL, get(SP::LDXri), DestReg).addFrameIndex(FI).addImm(0)
937937 FIN = DAG.getNode(ISD::ADD, DL, PtrVT, FIN,
938938 DAG.getIntPtrConstant(4, DL));
939939 ArgValue = DAG.getLoad(LocVT, DL, Chain, FIN,
940 MachinePointerInfo::getFixedStack(FI),
941 false, false, false, 0);
940 MachinePointerInfo::getFixedStack(MF, FI), false,
941 false, false, 0);
942942 }
943943
944944 // Convert the value of the argument register into the value that's
974974 &SystemZ::FP64BitRegClass);
975975 SDValue ArgValue = DAG.getCopyFromReg(Chain, DL, VReg, MVT::f64);
976976 MemOps[I] = DAG.getStore(ArgValue.getValue(1), DL, ArgValue, FIN,
977 MachinePointerInfo::getFixedStack(FI),
977 MachinePointerInfo::getFixedStack(MF, FI),
978978 false, false, 0);
979
980979 }
981980 // Join the stores, which are independent of one another.
982981 Chain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other,
10581057 // Store the argument in a stack slot and pass its address.
10591058 SDValue SpillSlot = DAG.CreateStackTemporary(VA.getValVT());
10601059 int FI = cast(SpillSlot)->getIndex();
1061 MemOpChains.push_back(DAG.getStore(Chain, DL, ArgValue, SpillSlot,
1062 MachinePointerInfo::getFixedStack(FI),
1063 false, false, 0));
1060 MemOpChains.push_back(DAG.getStore(
1061 Chain, DL, ArgValue, SpillSlot,
1062 MachinePointerInfo::getFixedStack(MF, FI), false, false, 0));
10641063 ArgValue = SpillSlot;
10651064 } else
10661065 ArgValue = convertValVTToLocVT(DAG, DL, VA, ArgValue);
24232422 Result = DAG.getTargetGlobalAddress(GV, DL, PtrVT, 0, SystemZII::MO_GOT);
24242423 Result = DAG.getNode(SystemZISD::PCREL_WRAPPER, DL, PtrVT, Result);
24252424 Result = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), Result,
2426 MachinePointerInfo::getGOT(), false, false, false, 0);
2425 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
2426 false, false, false, 0);
24272427 }
24282428
24292429 // If there was a non-zero offset that we didn't fold, create an explicit
25152515 SystemZConstantPoolValue::Create(GV, SystemZCP::TLSGD);
25162516
25172517 Offset = DAG.getConstantPool(CPV, PtrVT, 8);
2518 Offset = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(),
2519 Offset, MachinePointerInfo::getConstantPool(),
2520 false, false, false, 0);
2518 Offset = DAG.getLoad(
2519 PtrVT, DL, DAG.getEntryNode(), Offset,
2520 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2521 false, false, 0);
25212522
25222523 // Call __tls_get_offset to retrieve the offset.
25232524 Offset = lowerTLSGetOffset(Node, DAG, SystemZISD::TLS_GDCALL, Offset);
25302531 SystemZConstantPoolValue::Create(GV, SystemZCP::TLSLDM);
25312532
25322533 Offset = DAG.getConstantPool(CPV, PtrVT, 8);
2533 Offset = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(),
2534 Offset, MachinePointerInfo::getConstantPool(),
2535 false, false, false, 0);
2534 Offset = DAG.getLoad(
2535 PtrVT, DL, DAG.getEntryNode(), Offset,
2536 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2537 false, false, 0);
25362538
25372539 // Call __tls_get_offset to retrieve the module base offset.
25382540 Offset = lowerTLSGetOffset(Node, DAG, SystemZISD::TLS_LDCALL, Offset);
25482550 CPV = SystemZConstantPoolValue::Create(GV, SystemZCP::DTPOFF);
25492551
25502552 SDValue DTPOffset = DAG.getConstantPool(CPV, PtrVT, 8);
2551 DTPOffset = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(),
2552 DTPOffset, MachinePointerInfo::getConstantPool(),
2553 false, false, false, 0);
2553 DTPOffset = DAG.getLoad(
2554 PtrVT, DL, DAG.getEntryNode(), DTPOffset,
2555 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2556 false, false, 0);
25542557
25552558 Offset = DAG.getNode(ISD::ADD, DL, PtrVT, Offset, DTPOffset);
25562559 break;
25612564 Offset = DAG.getTargetGlobalAddress(GV, DL, PtrVT, 0,
25622565 SystemZII::MO_INDNTPOFF);
25632566 Offset = DAG.getNode(SystemZISD::PCREL_WRAPPER, DL, PtrVT, Offset);
2564 Offset = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(),
2565 Offset, MachinePointerInfo::getGOT(),
2567 Offset = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), Offset,
2568 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
25662569 false, false, false, 0);
25672570 break;
25682571 }
25732576 SystemZConstantPoolValue::Create(GV, SystemZCP::NTPOFF);
25742577
25752578 Offset = DAG.getConstantPool(CPV, PtrVT, 8);
2576 Offset = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(),
2577 Offset, MachinePointerInfo::getConstantPool(),
2578 false, false, false, 0);
2579 Offset = DAG.getLoad(
2580 PtrVT, DL, DAG.getEntryNode(), Offset,
2581 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
2582 false, false, 0);
25792583 break;
25802584 }
25812585 }
3434 if (MCID.mayStore())
3535 Flags |= MachineMemOperand::MOStore;
3636 int64_t Offset = 0;
37 MachineMemOperand *MMO =
38 MF.getMachineMemOperand(MachinePointerInfo(
39 PseudoSourceValue::getFixedStack(FI), Offset),
40 Flags, MFFrame->getObjectSize(FI),
41 MFFrame->getObjectAlignment(FI));
37 MachineMemOperand *MMO = MF.getMachineMemOperand(
38 MachinePointerInfo::getFixedStack(MF, FI, Offset), Flags,
39 MFFrame->getObjectSize(FI), MFFrame->getObjectAlignment(FI));
4240 return MIB.addFrameIndex(FI).addImm(Offset).addReg(0).addMemOperand(MMO);
4341 }
4442
30193019 ISD::ArgFlagsTy Flags = OutFlags[VA.getValNo()];
30203020 unsigned Alignment = DL.getABITypeAlignment(ArgVal->getType());
30213021 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
3022 MachinePointerInfo::getStack(LocMemOffset), MachineMemOperand::MOStore,
3023 ArgVT.getStoreSize(), Alignment);
3022 MachinePointerInfo::getStack(*FuncInfo.MF, LocMemOffset),
3023 MachineMemOperand::MOStore, ArgVT.getStoreSize(), Alignment);
30243024 if (Flags.isByVal()) {
30253025 X86AddressMode SrcAM;
30263026 SrcAM.Base.Reg = ArgReg;
33833383 TII.get(Opc), ResultReg);
33843384 addDirectMem(MIB, AddrReg);
33853385 MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand(
3386 MachinePointerInfo::getConstantPool(), MachineMemOperand::MOLoad,
3387 DL.getPointerSize(), Align);
3386 MachinePointerInfo::getConstantPool(*FuncInfo.MF),
3387 MachineMemOperand::MOLoad, DL.getPointerSize(), Align);
33883388 MIB->addMemOperand(*FuncInfo.MF, MMO);
33893389 return ResultReg;
33903390 }
23992399 int FI = MFI->CreateFixedObject(ValVT.getSizeInBits()/8,
24002400 VA.getLocMemOffset(), isImmutable);
24012401 SDValue FIN = DAG.getFrameIndex(FI, getPointerTy(DAG.getDataLayout()));
2402 SDValue Val = DAG.getLoad(ValVT, dl, Chain, FIN,
2403 MachinePointerInfo::getFixedStack(FI),
2404 false, false, false, 0);
2402 SDValue Val = DAG.getLoad(
2403 ValVT, dl, Chain, FIN,
2404 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI), false,
2405 false, false, 0);
24052406 return ExtendedInMem ?
24062407 DAG.getNode(ISD::TRUNCATE, dl, VA.getValVT(), Val) : Val;
24072408 }
26732674 SDValue FIN = DAG.getNode(ISD::ADD, dl, getPointerTy(DAG.getDataLayout()),
26742675 RSFIN, DAG.getIntPtrConstant(Offset, dl));
26752676 SDValue Store =
2676 DAG.getStore(Val.getValue(1), dl, Val, FIN,
2677 MachinePointerInfo::getFixedStack(
2678 FuncInfo->getRegSaveFrameIndex(), Offset),
2679 false, false, 0);
2677 DAG.getStore(Val.getValue(1), dl, Val, FIN,
2678 MachinePointerInfo::getFixedStack(
2679 DAG.getMachineFunction(),
2680 FuncInfo->getRegSaveFrameIndex(), Offset),
2681 false, false, 0);
26802682 MemOps.push_back(Store);
26812683 Offset += 8;
26822684 }
27172719 SDValue Val = DAG.getCopyFromReg(Chain, dl, GPR, MVT::i64);
27182720 Chain = DAG.getStore(
27192721 Val.getValue(1), dl, Val, RSFIN,
2720 MachinePointerInfo::getFixedStack(FuncInfo->getRegSaveFrameIndex()),
2722 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(),
2723 FuncInfo->getRegSaveFrameIndex()),
27212724 /*isVolatile=*/true, /*isNonTemporal=*/false, /*Alignment=*/0);
27222725 }
27232726
27922795 MMI.getWinEHFuncInfo(MF.getFunction()).UnwindHelpFrameIdx = UnwindHelpFI;
27932796 SDValue Neg2 = DAG.getConstant(-2, dl, MVT::i64);
27942797 Chain = DAG.getStore(Chain, dl, Neg2, StackSlot,
2795 MachinePointerInfo::getFixedStack(UnwindHelpFI),
2798 MachinePointerInfo::getFixedStack(
2799 DAG.getMachineFunction(), UnwindHelpFI),
27962800 /*isVolatile=*/true,
27972801 /*isNonTemporal=*/false, /*Alignment=*/0);
27982802 } else {
28192823 if (Flags.isByVal())
28202824 return CreateCopyOfByValArgument(Arg, PtrOff, Chain, Flags, DAG, dl);
28212825
2822 return DAG.getStore(Chain, dl, Arg, PtrOff,
2823 MachinePointerInfo::getStack(LocMemOffset),
2824 false, false, 0);
2826 return DAG.getStore(
2827 Chain, dl, Arg, PtrOff,
2828 MachinePointerInfo::getStack(DAG.getMachineFunction(), LocMemOffset),
2829 false, false, 0);
28252830 }
28262831
28272832 /// Emit a load of return address if tail call
28552860 false);
28562861 SDValue NewRetAddrFrIdx = DAG.getFrameIndex(NewReturnAddrFI, PtrVT);
28572862 Chain = DAG.getStore(Chain, dl, RetAddrFrIdx, NewRetAddrFrIdx,
2858 MachinePointerInfo::getFixedStack(NewReturnAddrFI),
2863 MachinePointerInfo::getFixedStack(
2864 DAG.getMachineFunction(), NewReturnAddrFI),
28592865 false, false, 0);
28602866 return Chain;
28612867 }
30413047 // Store the argument.
30423048 SDValue SpillSlot = DAG.CreateStackTemporary(VA.getValVT());
30433049 int FI = cast(SpillSlot)->getIndex();
3044 Chain = DAG.getStore(Chain, dl, Arg, SpillSlot,
3045 MachinePointerInfo::getFixedStack(FI),
3046 false, false, 0);
3050 Chain = DAG.getStore(
3051 Chain, dl, Arg, SpillSlot,
3052 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
3053 false, false, 0);
30473054 Arg = SpillSlot;
30483055 break;
30493056 }
31793186 Flags, DAG, dl));
31803187 } else {
31813188 // Store relative to framepointer.
3182 MemOpChains2.push_back(
3183 DAG.getStore(ArgChain, dl, Arg, FIN,
3184 MachinePointerInfo::getFixedStack(FI),
3185 false, false, 0));
3189 MemOpChains2.push_back(DAG.getStore(
3190 ArgChain, dl, Arg, FIN,
3191 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI),
3192 false, false, 0));
31863193 }
31873194 }
31883195
32613268 if (ExtraLoad)
32623269 Callee = DAG.getLoad(
32633270 getPointerTy(DAG.getDataLayout()), dl, DAG.getEntryNode(), Callee,
3264 MachinePointerInfo::getGOT(), false, false, false, 0);
3271 MachinePointerInfo::getGOT(DAG.getMachineFunction()), false, false,
3272 false, 0);
32653273 }
32663274 } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) {
32673275 unsigned char OpFlags = 0;
52175225 SDValue CP =
52185226 DAG.getConstantPool(C, TLI.getPointerTy(DAG.getDataLayout()));
52195227 unsigned Alignment = cast(CP)->getAlignment();
5220 Ld = DAG.getLoad(CVT, dl, DAG.getEntryNode(), CP,
5221 MachinePointerInfo::getConstantPool(),
5222 false, false, false, Alignment);
5228 Ld = DAG.getLoad(
5229 CVT, dl, DAG.getEntryNode(), CP,
5230 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), false,
5231 false, false, Alignment);
52235232
52245233 return DAG.getNode(X86ISD::VBROADCAST, dl, VT, Ld);
52255234 }
1140011409 // load.
1140111410 if (isGlobalStubReference(OpFlag))
1140211411 Result = DAG.getLoad(PtrVT, DL, DAG.getEntryNode(), Result,
11403 MachinePointerInfo::getGOT(), false, false, false, 0);
11412 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
11413 false, false, false, 0);
1140411414
1140511415 return Result;
1140611416 }
1146711477 // load.
1146811478 if (isGlobalStubReference(OpFlags))
1146911479 Result = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Result,
11470 MachinePointerInfo::getGOT(), false, false, false, 0);
11480 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
11481 false, false, false, 0);
1147111482
1147211483 // If there was a non-zero offset that we didn't fold, create an explicit
1147311484 // addition for it.
1162411635 }
1162511636
1162611637 Offset = DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Offset,
11627 MachinePointerInfo::getGOT(), false, false, false, 0);
11638 MachinePointerInfo::getGOT(DAG.getMachineFunction()),
11639 false, false, false, 0);
1162811640 }
1162911641
1163011642 // The address of the thread local variable is the add of the thread
1186911881 auto PtrVT = getPointerTy(MF.getDataLayout());
1187011882 int SSFI = MF.getFrameInfo()->CreateStackObject(Size, Size, false);
1187111883 SDValue StackSlot = DAG.getFrameIndex(SSFI, PtrVT);
11872 SDValue Chain = DAG.getStore(DAG.getEntryNode(), dl, Op.getOperand(0),
11873 StackSlot,
11874 MachinePointerInfo::getFixedStack(SSFI),
11875 false, false, 0);
11884 SDValue Chain = DAG.getStore(
11885 DAG.getEntryNode(), dl, Op.getOperand(0), StackSlot,
11886 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI), false,
11887 false, 0);
1187611888 return BuildFILD(Op, SrcVT, Chain, StackSlot, DAG);
1187711889 }
1187811890
1189411906 MachineMemOperand *MMO;
1189511907 if (FI) {
1189611908 int SSFI = FI->getIndex();
11897 MMO =
11898 DAG.getMachineFunction()
11899 .getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
11900 MachineMemOperand::MOLoad, ByteSize, ByteSize);
11909 MMO = DAG.getMachineFunction().getMachineMemOperand(
11910 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI),
11911 MachineMemOperand::MOLoad, ByteSize, ByteSize);
1190111912 } else {
1190211913 MMO = cast(StackSlot)->getMemOperand();
1190311914 StackSlot = StackSlot.getOperand(1);
1192311934 SDValue Ops[] = {
1192411935 Chain, Result, StackSlot, DAG.getValueType(Op.getValueType()), InFlag
1192511936 };
11926 MachineMemOperand *MMO =
11927 DAG.getMachineFunction()
11928 .getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
11929 MachineMemOperand::MOStore, SSFISize, SSFISize);
11937 MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
11938 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI),
11939 MachineMemOperand::MOStore, SSFISize, SSFISize);
1193011940
1193111941 Chain = DAG.getMemIntrinsicNode(X86ISD::FST, DL, Tys,
1193211942 Ops, Op.getValueType(), MMO);
11933 Result = DAG.getLoad(Op.getValueType(), DL, Chain, StackSlot,
11934 MachinePointerInfo::getFixedStack(SSFI),
11935 false, false, false, 0);
11943 Result = DAG.getLoad(
11944 Op.getValueType(), DL, Chain, StackSlot,
11945 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI),
11946 false, false, false, 0);
1193611947 }
1193711948
1193811949 return Result;
1197611987 // Load the 64-bit value into an XMM register.
1197711988 SDValue XR1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, MVT::v2i64,
1197811989 Op.getOperand(0));
11979 SDValue CLod0 = DAG.getLoad(MVT::v4i32, dl, DAG.getEntryNode(), CPIdx0,
11980 MachinePointerInfo::getConstantPool(),
11981 false, false, false, 16);
11990 SDValue CLod0 =
11991 DAG.getLoad(MVT::v4i32, dl, DAG.getEntryNode(), CPIdx0,
11992 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
11993 false, false, false, 16);
1198211994 SDValue Unpck1 =
1198311995 getUnpackl(DAG, dl, MVT::v4i32, DAG.getBitcast(MVT::v4i32, XR1), CLod0);
1198411996
11985 SDValue CLod1 = DAG.getLoad(MVT::v2f64, dl, CLod0.getValue(1), CPIdx1,
11986 MachinePointerInfo::getConstantPool(),
11987 false, false, false, 16);
11997 SDValue CLod1 =
11998 DAG.getLoad(MVT::v2f64, dl, CLod0.getValue(1), CPIdx1,
11999 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
12000 false, false, false, 16);
1198812001 SDValue XR2F = DAG.getBitcast(MVT::v2f64, Unpck1);
1198912002 SDValue Sub = DAG.getNode(ISD::FSUB, dl, MVT::v2f64, XR2F, CLod1);
1199012003 SDValue Result;
1223212245 // we must be careful to do the computation in x87 extended precision, not
1223312246 // in SSE. (The generic code can't know it's OK to do this, or how to.)
1223412247 int SSFI = cast(StackSlot)->getIndex();
12235 MachineMemOperand *MMO =
12236 DAG.getMachineFunction()
12237 .getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
12238 MachineMemOperand::MOLoad, 8, 8);
12248 MachineMemOperand *MMO = DAG.getMachineFunction().getMachineMemOperand(
12249 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), SSFI),
12250 MachineMemOperand::MOLoad, 8, 8);
1223912251
1224012252 SDVTList Tys = DAG.getVTList(MVT::f80, MVT::Other);
1224112253 SDValue Ops[] = { Store, StackSlot, DAG.getValueType(MVT::i64) };
1226212274
1226312275 // Load the value out, extending it from f32 to f80.
1226412276 // FIXME: Avoid the extend by constructing the right constant pool?
12265 SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, dl, MVT::f80, DAG.getEntryNode(),
12266 FudgePtr, MachinePointerInfo::getConstantPool(),
12267 MVT::f32, false, false, false, 4);
12277 SDValue Fudge = DAG.getExtLoad(
12278 ISD::EXTLOAD, dl, MVT::f80, DAG.getEntryNode(), FudgePtr,
12279 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), MVT::f32,
12280 false, false, false, 4);
1226812281 // Extend everything to 80 bits to force it to be done on x87.
1226912282 SDValue Add = DAG.getNode(ISD::FADD, dl, MVT::f80, Fild, Fudge);
1227012283 return DAG.getNode(ISD::FP_ROUND, dl, DstVT, Add,
1232312336 if (isScalarFPTypeInSSEReg(TheVT)) {
1232412337 assert(DstTy == MVT::i64 && "Invalid FP_TO_SINT to lower!");
1232512338 Chain = DAG.getStore(Chain, DL, Value, StackSlot,
12326 MachinePointerInfo::getFixedStack(SSFI),
12327 false, false, 0);
12339 MachinePointerInfo::getFixedStack(MF, SSFI), false,
12340 false, 0);
1232812341 SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(), MVT::Other);
1232912342 SDValue Ops[] = {
1233012343 Chain, StackSlot, DAG.getValueType(TheVT)
1233112344 };
1233212345
1233312346 MachineMemOperand *MMO =
12334 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
12335 MachineMemOperand::MOLoad, MemSize, MemSize);
12347 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(MF, SSFI),
12348 MachineMemOperand::MOLoad, MemSize, MemSize);
1233612349 Value = DAG.getMemIntrinsicNode(X86ISD::FLD, DL, Tys, Ops, DstTy, MMO);
1233712350 Chain = Value.getValue(1);
1233812351 SSFI = MF.getFrameInfo()->CreateStackObject(MemSize, MemSize, false);
1234012353 }
1234112354
1234212355 MachineMemOperand *MMO =
12343 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
12344 MachineMemOperand::MOStore, MemSize, MemSize);
12356 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(MF, SSFI),
12357 MachineMemOperand::MOStore, MemSize, MemSize);
1234512358
1234612359 if (Opc != X86ISD::WIN_FTOL) {
1234712360 // Build the FP_TO_INT*_IN_MEM
1271712730 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
1271812731 SDValue CPIdx = DAG.getConstantPool(C, TLI.getPointerTy(DAG.getDataLayout()));
1271912732 unsigned Alignment = cast(CPIdx)->getAlignment();
12720 SDValue Mask = DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx,
12721 MachinePointerInfo::getConstantPool(),
12722 false, false, false, Alignment);
12733 SDValue Mask =
12734 DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx,
12735 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
12736 false, false, false, Alignment);
1272312737
1272412738 SDValue Op0 = Op.getOperand(0);
1272512739 bool IsFNABS = !IsFABS && (Op0.getOpcode() == ISD::FABS);
1278012794 // scalar FP logic instructions in SSE. This allows load folding of the
1278112795 // constants into the logic instructions.
1278212796 MVT LogicVT = (VT == MVT::f64) ? MVT::v2f64 : MVT::v4f32;
12783 SDValue Mask1 = DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx,
12784 MachinePointerInfo::getConstantPool(),
12785 false, false, false, 16);
12797 SDValue Mask1 =
12798 DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx,
12799 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
12800 false, false, false, 16);
1278612801 Op1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, LogicVT, Op1);
1278712802 SDValue SignBit = DAG.getNode(X86ISD::FAND, dl, LogicVT, Op1, Mask1);
1278812803
1280312818 }
1280412819 C = ConstantVector::get(CV);
1280512820 CPIdx = DAG.getConstantPool(C, PtrVT, 16);
12806 SDValue Val = DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx,
12807 MachinePointerInfo::getConstantPool(),
12808 false, false, false, 16);
12821 SDValue Val =
12822 DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx,
12823 MachinePointerInfo::getConstantPool(DAG.getMachineFunction()),
12824 false, false, false, 16);
1280912825 // If the magnitude operand wasn't a constant, we need to AND out the sign.
1281012826 if (!isa(Op0)) {
1281112827 Op0 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, LogicVT, Op0);
1669916715 DAG.getFrameIndex(SSFI, getPointerTy(DAG.getDataLayout()));
1670016716
1670116717 MachineMemOperand *MMO =
16702 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(SSFI),
16703 MachineMemOperand::MOStore, 2, 2);
16718 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(MF, SSFI),
16719 MachineMemOperand::MOStore, 2, 2);
1670416720
1670516721 SDValue Ops[] = { DAG.getEntryNode(), StackSlot };
1670616722 SDValue Chain = DAG.getMemIntrinsicNode(X86ISD::FNSTCW16m, DL,
1988819904 // In the XMM save block, save all the XMM argument registers.
1988919905 for (int i = 3, e = MI->getNumOperands() - 1; i != e; ++i) {
1989019906 int64_t Offset = (i - 3) * 16 + VarArgsFPOffset;
19891 MachineMemOperand *MMO =
19892 F->getMachineMemOperand(
19893 MachinePointerInfo::getFixedStack(RegSaveFrameIndex, Offset),
19907 MachineMemOperand *MMO = F->getMachineMemOperand(
19908 MachinePointerInfo::getFixedStack(*F, RegSaveFrameIndex, Offset),
1989419909 MachineMemOperand::MOStore,
1989519910 /*Size=*/16, /*Align=*/16);
1989619911 BuildMI(XMMSaveMBB, DL, TII->get(MOVOpc))
155155 Flags |= MachineMemOperand::MOLoad;
156156 if (MCID.mayStore())
157157 Flags |= MachineMemOperand::MOStore;
158 MachineMemOperand *MMO =
159 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI, Offset),
160 Flags, MFI.getObjectSize(FI),
161 MFI.getObjectAlignment(FI));
158 MachineMemOperand *MMO = MF.getMachineMemOperand(
159 MachinePointerInfo::getFixedStack(MF, FI, Offset), Flags,
160 MFI.getObjectSize(FI), MFI.getObjectAlignment(FI));
162161 return addOffset(MIB.addFrameIndex(FI), Offset)
163162 .addMemOperand(MMO);
164163 }
47624762 const GlobalValue *GV =
47634763 cast((*MIB->memoperands_begin())->getValue());
47644764 unsigned Flag = MachineMemOperand::MOLoad | MachineMemOperand::MOInvariant;
4765 MachineMemOperand *MMO = MBB.getParent()->
4766 getMachineMemOperand(MachinePointerInfo::getGOT(), Flag, 8, 8);
4765 MachineMemOperand *MMO = MBB.getParent()->getMachineMemOperand(
4766 MachinePointerInfo::getGOT(*MBB.getParent()), Flag, 8, 8);
47674767 MachineBasicBlock::iterator I = MIB.getInstr();
47684768
47694769 BuildMI(MBB, I, DL, TII.get(X86::MOV64rm), Reg).addReg(X86::RIP).addImm(1)
176176 getFrameIndexMMO(MachineBasicBlock &MBB, int FrameIndex, unsigned flags) {
177177 MachineFunction *MF = MBB.getParent();
178178 const MachineFrameInfo &MFI = *MF->getFrameInfo();
179 MachineMemOperand *MMO =
180 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIndex),
181 flags, MFI.getObjectSize(FrameIndex),
182 MFI.getObjectAlignment(FrameIndex));
179 MachineMemOperand *MMO = MF->getMachineMemOperand(
180 MachinePointerInfo::getFixedStack(*MF, FrameIndex), flags,
181 MFI.getObjectSize(FrameIndex), MFI.getObjectAlignment(FrameIndex));
183182 return MMO;
184183 }
185184
150150 MVT::Other, CPIdx,
151151 CurDAG->getEntryNode());
152152 MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1);
153 MemOp[0] = MF->getMachineMemOperand(
154 MachinePointerInfo::getConstantPool(), MachineMemOperand::MOLoad, 4, 4);
153 MemOp[0] =
154 MF->getMachineMemOperand(MachinePointerInfo::getConstantPool(*MF),
155 MachineMemOperand::MOLoad, 4, 4);
155156 cast(node)->setMemRefs(MemOp, MemOp + 1);
156157 return node;
157158 }
838838 SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);
839839 return DAG.getLoad(
840840 getPointerTy(DAG.getDataLayout()), SDLoc(Op), DAG.getEntryNode(), FIN,
841 MachinePointerInfo::getFixedStack(FI), false, false, false, 0);
841 MachinePointerInfo::getFixedStack(MF, FI), false, false, false, 0);
842842 }
843843
844844 SDValue XCoreTargetLowering::
13661366 //from this parameter
13671367 SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);
13681368 ArgIn = DAG.getLoad(VA.getLocVT(), dl, Chain, FIN,
1369 MachinePointerInfo::getFixedStack(FI),
1370 false, false, false, 0);
1369 MachinePointerInfo::getFixedStack(MF, FI), false,
1370 false, false, 0);
13711371 }
13721372 const ArgDataPair ADP = { ArgIn, Ins[i].Flags };
13731373 ArgData.push_back(ADP);
15161516 // Create a SelectionDAG node corresponding to a store
15171517 // to this memory location.
15181518 SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);
1519 MemOpChains.push_back(DAG.getStore(Chain, dl, OutVals[i], FIN,
1520 MachinePointerInfo::getFixedStack(FI), false, false,
1521 0));
1519 MemOpChains.push_back(DAG.getStore(
1520 Chain, dl, OutVals[i], FIN,
1521 MachinePointerInfo::getFixedStack(DAG.getMachineFunction(), FI), false,
1522 false, 0));
15221523 }
15231524
15241525 // Transform all store nodes into one single node because
367367 DL = I->getDebugLoc();
368368 MachineFunction *MF = MBB.getParent();
369369 const MachineFrameInfo &MFI = *MF->getFrameInfo();
370 MachineMemOperand *MMO =
371 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIndex),
372 MachineMemOperand::MOStore,
373 MFI.getObjectSize(FrameIndex),
374 MFI.getObjectAlignment(FrameIndex));
370 MachineMemOperand *MMO = MF->getMachineMemOperand(
371 MachinePointerInfo::getFixedStack(*MF, FrameIndex),
372 MachineMemOperand::MOStore, MFI.getObjectSize(FrameIndex),
373 MFI.getObjectAlignment(FrameIndex));
375374 BuildMI(MBB, I, DL, get(XCore::STWFI))
376375 .addReg(SrcReg, getKillRegState(isKill))
377376 .addFrameIndex(FrameIndex)
390389 DL = I->getDebugLoc();
391390 MachineFunction *MF = MBB.getParent();
392391 const MachineFrameInfo &MFI = *MF->getFrameInfo();
393 MachineMemOperand *MMO =
394 MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIndex),
395 MachineMemOperand::MOLoad,
396 MFI.getObjectSize(FrameIndex),
397 MFI.getObjectAlignment(FrameIndex));
392 MachineMemOperand *MMO = MF->getMachineMemOperand(
393 MachinePointerInfo::getFixedStack(*MF, FrameIndex),
394 MachineMemOperand::MOLoad, MFI.getObjectSize(FrameIndex),
395 MFI.getObjectAlignment(FrameIndex));
398396 BuildMI(MBB, I, DL, get(XCore::LDWFI), DestReg)
399397 .addFrameIndex(FrameIndex)
400398 .addImm(0)