Home | History | Annotate | Download | only in WebAssembly

Lines Matching defs:DAG

1 //=- WebAssemblyISelLowering.cpp - WebAssembly DAG Lowering Implementation -==//
296 static void fail(SDLoc DL, SelectionDAG &DAG, const char *msg) {
297 MachineFunction &MF = DAG.getMachineFunction();
298 DAG.getContext()->diagnose(
318 SelectionDAG &DAG = CLI.DAG;
322 MachineFunction &MF = DAG.getMachineFunction();
326 fail(DL, DAG,
330 fail(DL, DAG, "WebAssembly doesn't support patch point yet");
337 fail(DL, DAG, "WebAssembly doesn't support tail call yet");
344 fail(DL, DAG, "WebAssembly doesn't support more than 1 returned value yet");
349 fail(DL, DAG, "WebAssembly hasn't implemented byval arguments");
351 fail(DL, DAG, "WebAssembly hasn't implemented nest arguments");
353 fail(DL, DAG, "WebAssembly hasn't implemented inalloca arguments");
355 fail(DL, DAG, "WebAssembly hasn't implemented cons regs arguments");
357 fail(DL, DAG, "WebAssembly hasn't implemented cons regs last arguments");
366 CCState CCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.getContext());
376 Type *Ty = VT.getTypeForEVT(*DAG.getContext());
390 NB = DAG.getConstant(NumBytes, DL, PtrVT, true);
391 Chain = DAG.getCALLSEQ_START(Chain, NB, DL);
397 SDValue SP = DAG.getCopyFromReg(
406 SDValue Add = DAG.getNode(ISD::ADD, DL, PtrVT, SP,
407 DAG.getConstant(Offset, DL, PtrVT));
408 Chains.push_back(DAG.getStore(Chain, DL, Arg, Add,
413 Chain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other, Chains);
431 fail(DL, DAG, "WebAssembly hasn't implemented inalloca return values");
433 fail(DL, DAG, "WebAssembly hasn't implemented cons regs return values");
435 fail(DL, DAG,
442 SDVTList TyList = DAG.getVTList(Tys);
444 DAG.getNode(Ins.empty() ? WebAssemblyISD::CALL0 : WebAssemblyISD::CALL1,
454 SDValue Unused = DAG.getTargetConstant(0, DL, PtrVT);
455 Chain = DAG.getCALLSEQ_END(Chain, NB, Unused, SDValue(), DL);
473 SelectionDAG &DAG) const {
476 fail(DL, DAG, "WebAssembly doesn't support non-C calling conventions");
480 Chain = DAG.getNode(WebAssemblyISD::RETURN, DL, MVT::Other, RetOps);
488 fail(DL, DAG, "WebAssembly hasn't implemented inalloca results");
490 fail(DL, DAG, "WebAssembly hasn't implemented cons regs results");
492 fail(DL, DAG, "WebAssembly hasn't implemented cons regs last results");
500 const SmallVectorImpl<ISD::InputArg> &Ins, SDLoc DL, SelectionDAG &DAG,
502 MachineFunction &MF = DAG.getMachineFunction();
505 fail(DL, DAG, "WebAssembly doesn't support non-C calling conventions");
513 fail(DL, DAG, "WebAssembly hasn't implemented byval arguments");
515 fail(DL, DAG, "WebAssembly hasn't implemented inalloca arguments");
517 fail(DL, DAG, "WebAssembly hasn't implemented nest arguments");
519 fail(DL, DAG, "WebAssembly hasn't implemented cons regs arguments");
521 fail(DL, DAG, "WebAssembly hasn't implemented cons regs last arguments");
526 ? DAG.getNode(WebAssemblyISD::ARGUMENT, DL, In.VT,
527 DAG.getTargetConstant(InVals.size(), DL, MVT::i32))
528 : DAG.getUNDEF(In.VT));
545 SelectionDAG &DAG) const {
551 return LowerFrameIndex(Op, DAG);
553 return LowerGlobalAddress(Op, DAG);
555 return LowerExternalSymbol(Op, DAG);
557 return LowerJumpTable(Op, DAG);
559 return LowerBR_JT(Op, DAG);
561 return LowerVASTART(Op, DAG);
566 SelectionDAG &DAG) const {
568 return DAG.getTargetFrameIndex(FI, Op.getValueType());
572 SelectionDAG &DAG) const {
578 fail(DL, DAG, "WebAssembly only expects the 0 address space");
579 return DAG.getNode(
581 DAG.getTargetGlobalAddress(GA->getGlobal(), DL, VT, GA->getOffset()));
586 SelectionDAG &DAG) const {
591 return DAG.getNode(WebAssemblyISD::Wrapper, DL, VT,
592 DAG.getTargetExternalSymbol(ES->getSymbol(), VT));
596 SelectionDAG &DAG) const {
601 return DAG.getTargetJumpTable(JT->getIndex(), Op.getValueType(),
606 SelectionDAG &DAG) const {
617 MachineJumpTableInfo *MJTI = DAG.getMachineFunction().getJumpTableInfo();
623 Ops.push_back(DAG.getBasicBlock(MBBs[0]));
627 Ops.push_back(DAG.getBasicBlock(MBB));
629 return DAG.getNode(WebAssemblyISD::TABLESWITCH, DL, MVT::Other, Ops);
633 SelectionDAG &DAG) const {
635 EVT PtrVT = getPointerTy(DAG.getMachineFunction().getDataLayout());
640 DAG.getMachineFunction().getFrameInfo()->setFrameAddressIsTaken(true);
642 Subtarget->getRegisterInfo()->getFrameRegister(DAG.getMachineFunction());
643 SDValue FrameAddr = DAG.getCopyFromReg(DAG.getEntryNode(), DL, FP, PtrVT);
645 return DAG.getStore(Op.getOperand(0), DL, FrameAddr, Op.getOperand(1),