llvm.org GIT mirror llvm / 93a95ae
force clients of MachineFunction::getMachineMemOperand to provide a MachinePointerInfo, propagating the type out a level of API. Remove the old MachineFunction::getMachineMemOperand impl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114393 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
5 changed file(s) with 19 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
368368 /// getMachineMemOperand - Allocate a new MachineMemOperand.
369369 /// MachineMemOperands are owned by the MachineFunction and need not be
370370 /// explicitly deallocated.
371 MachineMemOperand *getMachineMemOperand(const Value *v, unsigned f,
372 int64_t o, uint64_t s,
373 unsigned base_alignment);
374
375 /// getMachineMemOperand - Allocate a new MachineMemOperand.
376 /// MachineMemOperands are owned by the MachineFunction and need not be
377 /// explicitly deallocated.
378371 MachineMemOperand *getMachineMemOperand(MachinePointerInfo PtrInfo,
379372 unsigned f, uint64_t s,
380373 unsigned base_alignment);
3636 /// Offset - This is an offset from the base Value*.
3737 int64_t Offset;
3838
39 MachinePointerInfo(const Value *v, int64_t offset) : V(v), Offset(offset) {}
39 explicit MachinePointerInfo(const Value *v, int64_t offset = 0)
40 : V(v), Offset(offset) {}
4041 };
4142
4243
7374 MachineMemOperand(MachinePointerInfo PtrInfo, unsigned flags, uint64_t s,
7475 unsigned base_alignment);
7576
77 const MachinePointerInfo &getPointerInfo() const { return PtrInfo; }
78
7679 /// getValue - Return the base address of the memory access. This may either
7780 /// be a normal LLVM IR Value, or one of the special values used in CodeGen.
7881 /// Special values are those obtained via
189189 }
190190
191191 MachineMemOperand *
192 MachineFunction::getMachineMemOperand(const Value *v, unsigned f,
193 int64_t o, uint64_t s,
194 unsigned base_alignment) {
195 return new (Allocator) MachineMemOperand(MachinePointerInfo(v, o), f,
196 s, base_alignment);
197 }
198
199 MachineMemOperand *
200192 MachineFunction::getMachineMemOperand(MachinePointerInfo PtrInfo, unsigned f,
201193 uint64_t s, unsigned base_alignment) {
202194 return new (Allocator) MachineMemOperand(PtrInfo, f, s, base_alignment);
236228 else {
237229 // Clone the MMO and unset the store flag.
238230 MachineMemOperand *JustLoad =
239 getMachineMemOperand((*I)->getValue(),
231 getMachineMemOperand((*I)->getPointerInfo(),
240232 (*I)->getFlags() & ~MachineMemOperand::MOStore,
241 (*I)->getOffset(), (*I)->getSize(),
242 (*I)->getBaseAlignment());
233 (*I)->getSize(), (*I)->getBaseAlignment());
243234 Result[Index] = JustLoad;
244235 }
245236 ++Index;
268259 else {
269260 // Clone the MMO and unset the load flag.
270261 MachineMemOperand *JustStore =
271 getMachineMemOperand((*I)->getValue(),
262 getMachineMemOperand((*I)->getPointerInfo(),
272263 (*I)->getFlags() & ~MachineMemOperand::MOLoad,
273 (*I)->getOffset(), (*I)->getSize(),
274 (*I)->getBaseAlignment());
264 (*I)->getSize(), (*I)->getBaseAlignment());
275265 Result[Index] = JustStore;
276266 }
277267 ++Index;
36703670 SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT,
36713671 SDValue Chain,
36723672 SDValue Ptr, SDValue Cmp,
3673 SDValue Swp, const Value* PtrVal,
3673 SDValue Swp, const Value *PtrVal,
36743674 unsigned Alignment) {
36753675 if (Alignment == 0) // Ensure that codegen never sees alignment 0
36763676 Alignment = getEVTAlignment(MemVT);
36883688 Flags |= MachineMemOperand::MOVolatile;
36893689
36903690 MachineMemOperand *MMO =
3691 MF.getMachineMemOperand(PtrVal, Flags, 0,
3691 MF.getMachineMemOperand(MachinePointerInfo(PtrVal), Flags,
36923692 MemVT.getStoreSize(), Alignment);
36933693
36943694 return getAtomic(Opcode, dl, MemVT, Chain, Ptr, Cmp, Swp, MMO);
37413741 Flags |= MachineMemOperand::MOVolatile;
37423742
37433743 MachineMemOperand *MMO =
3744 MF.getMachineMemOperand(PtrVal, Flags, 0,
3744 MF.getMachineMemOperand(MachinePointerInfo(PtrVal), Flags,
37453745 MemVT.getStoreSize(), Alignment);
37463746
37473747 return getAtomic(Opcode, dl, MemVT, Chain, Ptr, Val, MMO);
38283828 if (Vol)
38293829 Flags |= MachineMemOperand::MOVolatile;
38303830 MachineMemOperand *MMO =
3831 MF.getMachineMemOperand(srcValue, Flags, SVOff,
3831 MF.getMachineMemOperand(MachinePointerInfo(srcValue, SVOff), Flags,
38323832 MemVT.getStoreSize(), Align);
38333833
38343834 return getMemIntrinsicNode(Opcode, dl, VTList, Ops, NumOps, MemVT, MMO);
38893889 if (isNonTemporal)
38903890 Flags |= MachineMemOperand::MONonTemporal;
38913891 MachineMemOperand *MMO =
3892 MF.getMachineMemOperand(SV, Flags, SVOffset,
3892 MF.getMachineMemOperand(MachinePointerInfo(SV, SVOffset), Flags,
38933893 MemVT.getStoreSize(), Alignment);
38943894 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
38953895 }
39933993 if (isNonTemporal)
39943994 Flags |= MachineMemOperand::MONonTemporal;
39953995 MachineMemOperand *MMO =
3996 MF.getMachineMemOperand(SV, Flags, SVOffset,
3996 MF.getMachineMemOperand(MachinePointerInfo(SV, SVOffset), Flags,
39973997 Val.getValueType().getStoreSize(), Alignment);
39983998
39993999 return getStore(Chain, dl, Val, Ptr, MMO);
40434043 if (isNonTemporal)
40444044 Flags |= MachineMemOperand::MONonTemporal;
40454045 MachineMemOperand *MMO =
4046 MF.getMachineMemOperand(SV, Flags, SVOffset, SVT.getStoreSize(), Alignment);
4046 MF.getMachineMemOperand(MachinePointerInfo(SV, SVOffset), Flags,
4047 SVT.getStoreSize(), Alignment);
40474048
40484049 return getTruncStore(Chain, dl, Val, Ptr, SVT, MMO);
40494050 }
251251 const MachineFrameInfo &MFI = *MF.getFrameInfo();
252252 assert(MFI.getObjectOffset(FI) != -1);
253253 MachineMemOperand *MMO =
254 MF.getMachineMemOperand(PseudoSourceValue::getFixedStack(FI),
255 Flags, /*Offset=*/0,
256 MFI.getObjectSize(FI),
254 MF.getMachineMemOperand(
255 MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)),
256 Flags, MFI.getObjectSize(FI),
257257 MFI.getObjectAlignment(FI));
258258 NewMI->addMemOperand(MF, MMO);
259259