llvm.org GIT mirror llvm / e863903
it's more elegant to put the "getConstantPool" and "getFixedStack" on the MachinePointerInfo class. While this isn't the problem I'm setting out to solve, it is the right way to eliminate PseudoSourceValue, so lets go with it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114406 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
6 changed file(s) with 48 addition(s) and 29 deletion(s). Raw diff Collapse all Expand all
4747 /// getAddrSpace - Return the LLVM IR address space number that this pointer
4848 /// points into.
4949 unsigned getAddrSpace() const;
50
51 /// getConstantPool - Return a MachinePointerInfo record that refers to the
52 /// constant pool.
53 static MachinePointerInfo getConstantPool();
54
55 /// getFixedStack - Return a MachinePointerInfo record that refers to the
56 /// the specified FrameIndex.
57 static MachinePointerInfo getFixedStack(int FI, int64_t offset = 0);
5058 };
5159
5260
341341 return cast(V->getType())->getAddressSpace();
342342 }
343343
344 /// getConstantPool - Return a MachinePointerInfo record that refers to the
345 /// constant pool.
346 MachinePointerInfo MachinePointerInfo::getConstantPool() {
347 return MachinePointerInfo(PseudoSourceValue::getConstantPool());
348 }
349
350 /// getFixedStack - Return a MachinePointerInfo record that refers to the
351 /// the specified FrameIndex.
352 MachinePointerInfo MachinePointerInfo::getFixedStack(int FI, int64_t offset) {
353 return MachinePointerInfo(PseudoSourceValue::getFixedStack(FI), offset);
354 }
355
344356
345357 MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, unsigned f,
346358 uint64_t s, unsigned int a)
264264
265265 HandleSDNode Dummy(CurDAG->getLoad(vecVT, dl,
266266 CurDAG->getEntryNode(), CGPoolOffset,
267 PseudoSourceValue::getConstantPool(),0,
267 MachinePointerInfo::getConstantPool(),
268268 false, false, Alignment));
269269 CurDAG->ReplaceAllUsesWith(SDValue(bvNode, 0), Dummy.getValue());
270270 if (SDNode *N = SelectCode(Dummy.getValue().getNode()))
661661
662662 // Re-emit as a v16i8 vector load
663663 result = DAG.getLoad(MVT::v16i8, dl, the_chain, basePtr,
664 LN->getSrcValue(), LN->getSrcValueOffset(),
664 LN->getPointerInfo(),
665665 LN->isVolatile(), LN->isNonTemporal(), 16);
666666
667667 // Update the chain
811811
812812 // Load the memory to which to store.
813813 alignLoadVec = DAG.getLoad(vecVT, dl, the_chain, basePtr,
814 SN->getSrcValue(), SN->getSrcValueOffset(),
814 SN->getPointerInfo(),
815815 SN->isVolatile(), SN->isNonTemporal(), 16);
816816
817817 // Update the chain
10791079 // or we're forced to do vararg
10801080 int FI = MFI->CreateFixedObject(ObjSize, ArgOffset, true);
10811081 SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
1082 ArgVal = DAG.getLoad(ObjectVT, dl, Chain, FIN, NULL, 0, false, false, 0);
1082 ArgVal = DAG.getLoad(ObjectVT, dl, Chain, FIN, MachinePointerInfo(),
1083 false, false, 0);
10831084 ArgOffset += StackSlotSize;
10841085 }
10851086
15861586 VA.getLocMemOffset(), isImmutable);
15871587 SDValue FIN = DAG.getFrameIndex(FI, getPointerTy());
15881588 return DAG.getLoad(ValVT, dl, Chain, FIN,
1589 MachinePointerInfo(PseudoSourceValue::getFixedStack(FI)),
1589 MachinePointerInfo::getFixedStack(FI),
15901590 false, false, 0);
15911591 }
15921592 }
17801780 SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i64);
17811781 SDValue Store =
17821782 DAG.getStore(Val.getValue(1), dl, Val, FIN,
1783 PseudoSourceValue::getFixedStack(
1784 FuncInfo->getRegSaveFrameIndex()),
1785 Offset, false, false, 0);
1783 MachinePointerInfo::getFixedStack(
1784 FuncInfo->getRegSaveFrameIndex(), Offset),
1785 false, false, 0);
17861786 MemOps.push_back(Store);
17871787 Offset += 8;
17881788 }
18901890 EVT VT = Is64Bit ? MVT::i64 : MVT::i32;
18911891 SDValue NewRetAddrFrIdx = DAG.getFrameIndex(NewReturnAddrFI, VT);
18921892 Chain = DAG.getStore(Chain, dl, RetAddrFrIdx, NewRetAddrFrIdx,
1893 PseudoSourceValue::getFixedStack(NewReturnAddrFI), 0,
1893 MachinePointerInfo::getFixedStack(NewReturnAddrFI),
18941894 false, false, 0);
18951895 return Chain;
18961896 }
20042004 SDValue SpillSlot = DAG.CreateStackTemporary(VA.getValVT());
20052005 int FI = cast(SpillSlot)->getIndex();
20062006 Chain = DAG.getStore(Chain, dl, Arg, SpillSlot,
2007 PseudoSourceValue::getFixedStack(FI), 0,
2007 MachinePointerInfo::getFixedStack(FI),
20082008 false, false, 0);
20092009 Arg = SpillSlot;
20102010 break;
21472147 // Store relative to framepointer.
21482148 MemOpChains2.push_back(
21492149 DAG.getStore(ArgChain, dl, Arg, FIN,
2150 PseudoSourceValue::getFixedStack(FI), 0,
2150 MachinePointerInfo::getFixedStack(FI),
21512151 false, false, 0));
21522152 }
21532153 }
63456345 SDValue StackSlot = DAG.getFrameIndex(SSFI, getPointerTy());
63466346 SDValue Chain = DAG.getStore(DAG.getEntryNode(), dl, Op.getOperand(0),
63476347 StackSlot,
6348 PseudoSourceValue::getFixedStack(SSFI), 0,
6348 MachinePointerInfo::getFixedStack(SSFI),
63496349 false, false, 0);
63506350 return BuildFILD(Op, SrcVT, Chain, StackSlot, DAG);
63516351 }
63816381 };
63826382 Chain = DAG.getNode(X86ISD::FST, dl, Tys, Ops, array_lengthof(Ops));
63836383 Result = DAG.getLoad(Op.getValueType(), dl, Chain, StackSlot,
6384 MachinePointerInfo(PseudoSourceValue::getFixedStack(SSFI)),
6384 MachinePointerInfo::getFixedStack(SSFI),
63856385 false, false, 0);
63866386 }
63876387
64556455 DAG.getIntPtrConstant(0)));
64566456 SDValue Unpck1 = getUnpackl(DAG, dl, MVT::v4i32, XR1, XR2);
64576457 SDValue CLod0 = DAG.getLoad(MVT::v4i32, dl, DAG.getEntryNode(), CPIdx0,
6458 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
6458 MachinePointerInfo::getConstantPool(),
64596459 false, false, 16);
64606460 SDValue Unpck2 = getUnpackl(DAG, dl, MVT::v4i32, Unpck1, CLod0);
64616461 SDValue XR2F = DAG.getNode(ISD::BIT_CONVERT, dl, MVT::v2f64, Unpck2);
64626462 SDValue CLod1 = DAG.getLoad(MVT::v2f64, dl, CLod0.getValue(1), CPIdx1,
6463 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
6463 MachinePointerInfo::getConstantPool(),
64646464 false, false, 16);
64656465 SDValue Sub = DAG.getNode(ISD::FSUB, dl, MVT::v2f64, XR2F, CLod1);
64666466
65866586 // Load the value out, extending it from f32 to f80.
65876587 // FIXME: Avoid the extend by constructing the right constant pool?
65886588 SDValue Fudge = DAG.getExtLoad(ISD::EXTLOAD, MVT::f80, dl, DAG.getEntryNode(),
6589 FudgePtr, PseudoSourceValue::getConstantPool(),
6590 0, MVT::f32, false, false, 4);
6589 FudgePtr, MachinePointerInfo::getConstantPool(),
6590 MVT::f32, false, false, 4);
65916591 // Extend everything to 80 bits to force it to be done on x87.
65926592 SDValue Add = DAG.getNode(ISD::FADD, dl, MVT::f80, Fild, Fudge);
65936593 return DAG.getNode(ISD::FP_ROUND, dl, DstVT, Add, DAG.getIntPtrConstant(0));
66376637 if (isScalarFPTypeInSSEReg(Op.getOperand(0).getValueType())) {
66386638 assert(DstTy == MVT::i64 && "Invalid FP_TO_SINT to lower!");
66396639 Chain = DAG.getStore(Chain, dl, Value, StackSlot,
6640 PseudoSourceValue::getFixedStack(SSFI), 0,
6640 MachinePointerInfo::getFixedStack(SSFI),
66416641 false, false, 0);
66426642 SDVTList Tys = DAG.getVTList(Op.getOperand(0).getValueType(), MVT::Other);
66436643 SDValue Ops[] = {
67106710 Constant *C = ConstantVector::get(CV);
67116711 SDValue CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
67126712 SDValue Mask = DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
6713 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
6713 MachinePointerInfo::getConstantPool(),
67146714 false, false, 16);
67156715 return DAG.getNode(X86ISD::FAND, dl, VT, Op.getOperand(0), Mask);
67166716 }
67376737 Constant *C = ConstantVector::get(CV);
67386738 SDValue CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
67396739 SDValue Mask = DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
6740 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
6740 MachinePointerInfo::getConstantPool(),
67416741 false, false, 16);
67426742 if (VT.isVector()) {
67436743 return DAG.getNode(ISD::BIT_CONVERT, dl, VT,
67866786 Constant *C = ConstantVector::get(CV);
67876787 SDValue CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
67886788 SDValue Mask1 = DAG.getLoad(SrcVT, dl, DAG.getEntryNode(), CPIdx,
6789 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
6789 MachinePointerInfo::getConstantPool(),
67906790 false, false, 16);
67916791 SDValue SignBit = DAG.getNode(X86ISD::FAND, dl, SrcVT, Op1, Mask1);
67926792
68156815 C = ConstantVector::get(CV);
68166816 CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
68176817 SDValue Mask2 = DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
6818 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
6818 MachinePointerInfo::getConstantPool(),
68196819 false, false, 16);
68206820 SDValue Val = DAG.getNode(X86ISD::FAND, dl, VT, Op0, Mask2);
68216821
83008300 Constant *C = ConstantVector::get(CV);
83018301 SDValue CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
83028302 SDValue Addend = DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
8303 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
8303 MachinePointerInfo::getConstantPool(),
83048304 false, false, 16);
83058305
83068306 Op = DAG.getNode(ISD::ADD, dl, VT, Op, Addend);
83228322 Constant *C = ConstantVector::get(CVM1);
83238323 SDValue CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
83248324 SDValue M = DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
8325 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
8325 MachinePointerInfo::getConstantPool(),
83268326 false, false, 16);
83278327
83288328 // r = pblendv(r, psllw(r & (char16)15, 4), a);
83398339 C = ConstantVector::get(CVM2);
83408340 CPIdx = DAG.getConstantPool(C, getPointerTy(), 16);
83418341 M = DAG.getLoad(VT, dl, DAG.getEntryNode(), CPIdx,
8342 MachinePointerInfo(PseudoSourceValue::getConstantPool()),
8342 MachinePointerInfo::getConstantPool(),
83438343 false, false, 16);
83448344
83458345 // r = pblendv(r, psllw(r & (char16)63, 2), a);
94709470 int64_t Offset = (i - 3) * 16 + VarArgsFPOffset;
94719471 MachineMemOperand *MMO =
94729472 F->getMachineMemOperand(
9473 MachinePointerInfo(PseudoSourceValue::getFixedStack(RegSaveFrameIndex),
9474 Offset),
9473 MachinePointerInfo::getFixedStack(RegSaveFrameIndex, Offset),
94759474 MachineMemOperand::MOStore,
94769475 /*Size=*/16, /*Align=*/16);
94779476 BuildMI(XMMSaveMBB, DL, TII->get(X86::MOVAPSmr))
156156 if (TID.mayStore())
157157 Flags |= MachineMemOperand::MOStore;
158158 MachineMemOperand *MMO =
159 MF.getMachineMemOperand(MachinePointerInfo(
160 PseudoSourceValue::getFixedStack(FI), Offset),
159 MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FI, Offset),
161160 Flags, MFI.getObjectSize(FI),
162161 MFI.getObjectAlignment(FI));
163162 return addOffset(MIB.addFrameIndex(FI), Offset)