search for: gettargetconst

Displaying 20 results from an estimated 26 matches for "gettargetconst".

2015 Apr 02
2
[LLVMdev] How to enable use of 64bit load/store for 32bit architecture
...its not pretty. First make i64 not be legal. Then, assuming the regclass you gave has some subregs, you can give load/store a custom legalisation where you change the i64 to MVT::Untyped. So something like this for ISD::STORE: SDValue ValueToBeStored = St.getOperand(…) auto SeqOps[] = { DAG.getTargetConstant(SP::IntPairRegClassID, MVT::i32), DAG.getNode(ISD::EXTRACT_ELEMENT, dl, MVT::i32, ValueToBeStored, DAG.getConstant(0, MVT::i32)), DAG.getTargetConstant(SP ::sub0, MVT::i32), DAG.getNode(ISD::EXTRACT_ELEMENT, dl, MVT::i32, ValueToBeStored, DAG.getConstant(1, MVT::i32)), DAG.getTargetConst...
2015 Apr 03
2
[LLVMdev] How to enable use of 64bit load/store for 32bit architecture
.... Then, assuming the regclass you gave has some subregs, you can give load/store a custom legalisation where you change the i64 to MVT::Untyped. So something like this for ISD::STORE: >> >> SDValue ValueToBeStored = St.getOperand(…) >> >> auto SeqOps[] = { >> DAG.getTargetConstant(SP::IntPairRegClassID, MVT::i32), >> DAG.getNode(ISD::EXTRACT_ELEMENT, dl, MVT::i32, ValueToBeStored, DAG.getConstant(0, MVT::i32)), >> DAG.getTargetConstant(SP ::sub0, MVT::i32), >> DAG.getNode(ISD::EXTRACT_ELEMENT, dl, MVT::i32, ValueToBeStored, DAG.getConstant(1, MVT::i32...
2016 Jun 24
3
creating Intrinsic DAG Node
...or result and Intrinsic ID), can't seem to find what cast is causing the issue here. On Fri, Jun 24, 2016 at 11:47 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > That's what I thought but I got the same error with: > > DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, VT, > DAG.getTargetConstant(Intrinsic::my_intrinsic, DL, MVT::i16), LHS); > > Thanks. > > What should this call look like? > > > On Fri, Jun 24, 2016 at 10:53 AM, <escha at apple.com> wrote: > >> The intrinsic ID is an int, not a float. >> >> —escha >> >> On Jun 2...
2013 Nov 26
2
[LLVMdev] R600/SI build failure on Leopard (Use of C++11)
....4 is no longer building on OS X Leopard (https://trac.macports.org/ticket/41548). It seems the issue is with a commit that you made back in April (referenced below) which added this to SIISelLowering.cpp: // Adjust the writemask in the node std::vector<SDValue> Ops; Ops.push_back(DAG.getTargetConstant(NewDmask, MVT::i32)); for (unsigned i = 1, e = Node->getNumOperands(); i != e; ++i) Ops.push_back(Node->getOperand(i)); Node = (MachineSDNode*)DAG.UpdateNodeOperands(Node, Ops.data(), Ops.size()); That fails with Leopard's libstdc++ STL which does not a data method for std::ve...
2010 Apr 29
2
[LLVMdev] Target Constants
In SelectionDAG, what's the difference between getConstant and getTargetConstant? One creates a node with opcode Constant and the other with TargetConstant. What's the semantic difference? In X86ISelLowering I need to create a constant vector and put it in memory so I can reference it as an operand. I don't see any examples of doing this. Is it possible? If so,...
2013 Feb 03
1
[LLVMdev] Chain and glue operands should occur at end of operand list
...I am writing a back end for CortexM0 (for self teaching purposes), I am working on LDR with immediate offset instruction. In the ARM backend, if the offset is 0, the following code is executed by the function ARMDAGToDAGISel::SelectThumbAddrModeImm5S Base = N.getOperand(0); OffImm = CurDAG->getTargetConstant(0, MVT::i32); If I do a similar thing in my backend, I get this assertion message. I found out that if I execute the code below, the problem disappear. Base = N; OffImm = CurDAG->getTargetConstant(0, TM.getTargetLowering()->getPointerTy()); Only the change for Base seems relevant to...
2006 Oct 16
0
[LLVMdev] Implicit defs
On Sat, 14 Oct 2006, Roman Levenstein wrote: >> On Sat, 14 Oct 2006, Roman Levenstein wrote: >>> Is it possible to dynamically define implicit defs for some >>> instructions? >> >> Yes! This is what explicit operands are :). Specifically, if you >> want to >> vary on a per-opcode basis what registers are used/def'd by the >> instruction,
2010 Nov 08
2
[LLVMdev] Creating tablegen patterns for intrinsics with no return value.
...k; ... SDValue Ops[6]; SDValue chain = Op.getOperand(0); unsigned numNodes = 0; if (inChain) { Ops[numNodes++] = chain; } SDValue Chain = Op.getOperand(0); Ops[numNodes++] = Op.getOperand((inChain) ? 2 : 1); Ops[numNodes++] = DAG.getConstant(1, MVT::i32); Ops[numNodes++] = DAG.getTargetConstant(0, MVT::i32); Op = DAG.getNode(IntNo, dl, EVT::EVT(MVT::i32), Ops, numNodes); if (outChain) { SDValue mv[2] = {Op, chain}; Op = DAG.getMergeValues(mv, 2, dl); } return Op; } I'm guessing I am not handling the chain correctly, but I'm not sure what I am doing wrong. Can s...
2013 Oct 04
1
[LLVMdev] ADDE to use branch registers
...pattern. The following code snippet is not really working for me: SDValue rvexTargetLowering:: LowerAddCG(SDValue Op, SelectionDAG &DAG) const { unsigned Opc = Op.getOpcode(); SDNode* N = Op.getNode(); EVT VT = Op.getValueType(); DebugLoc dl = N->getDebugLoc(); SDValue BReg = DAG.getTargetConstant(rvex::B0, VT); // Add extra register to output return DAG.getNode(rvexISD::Addc, dl, VT, N->getOperand(0), N->getOperand(1), BReg); } Could anybody advice me on a way to make the backend know that the ADDE instruction will cause a branch register to be used? Thanks in advance! Maur...
2006 Oct 15
2
[LLVMdev] Implicit defs
Hi Chris, Thanks for your response. > On Sat, 14 Oct 2006, Roman Levenstein wrote: > > Is it possible to dynamically define implicit defs for some > > instructions? > > Yes! This is what explicit operands are :). Specifically, if you > want to > vary on a per-opcode basis what registers are used/def'd by the > instruction, you can just add those registers
2009 Apr 13
1
[LLVMdev] Porting LLVM backend is no fun yet
Dan Gohman wrote: > There certainly are wishlist items for TableGen and TableGen-based > instruction descriptions, though I don't know of an official list. > Offhand, > a few things that come to mind are the ability to handle nodes with > multiple results, Is there an official workaround, BTW? - Volodya
2013 Nov 26
0
[LLVMdev] R600/SI build failure on Leopard (Use of C++11)
...lding on OS X Leopard (https://trac.macports.org/ticket/41548). It seems the issue is with a commit that you made back in April (referenced below) which added this to SIISelLowering.cpp: > > // Adjust the writemask in the node > std::vector<SDValue> Ops; > Ops.push_back(DAG.getTargetConstant(NewDmask, MVT::i32)); > for (unsigned i = 1, e = Node->getNumOperands(); i != e; ++i) > Ops.push_back(Node->getOperand(i)); > Node = (MachineSDNode*)DAG.UpdateNodeOperands(Node, Ops.data(), Ops.size()); > > That fails with Leopard's libstdc++ STL which does not a...
2019 Apr 03
2
Inline ASM Question
The code below is triggering some weird behavior that's different from how gcc treats this inline asm. Clang keeps the original type of "loc" as "bool", which generates an "i1 true" after inlining. So far so good. However, during ISEL, the "true" is converted to a signed integer. So when it's evaluated, the result is this: .quad
2015 Apr 02
2
[LLVMdev] How to enable use of 64bit load/store for 32bit architecture
In http://reviews.llvm.org/D8713, I added the 64bit integer store ("std") and load ("ldd") instructions for 32bit sparc. But now I need codegen to know how to emit them, and am not sure the best way to go about teaching the backend that 64bit integers can be used natively, but only for loads and stores. (I originally wrote an earlier draft of question in the review but it
2010 Nov 08
0
[LLVMdev] Creating tablegen patterns for intrinsics with no return value.
...= Op.getOperand(0); > unsigned numNodes = 0; > if (inChain) { > Ops[numNodes++] = chain; > } > SDValue Chain = Op.getOperand(0); > Ops[numNodes++] = Op.getOperand((inChain) ? 2 : 1); > Ops[numNodes++] = DAG.getConstant(1, MVT::i32); > Ops[numNodes++] = DAG.getTargetConstant(0, MVT::i32); > Op = DAG.getNode(IntNo, dl, EVT::EVT(MVT::i32), Ops, numNodes); > if (outChain) { > SDValue mv[2] = {Op, chain}; > Op = DAG.getMergeValues(mv, 2, dl); > } > return Op; > } > > I’m guessing I am not handling the chain correctly, but I’m...
2010 Nov 08
1
[LLVMdev] Creating tablegen patterns for intrinsics with no return value.
...d numNodes = 0; > > if (inChain) { > > Ops[numNodes++] = chain; > > } > > SDValue Chain = Op.getOperand(0); > > Ops[numNodes++] = Op.getOperand((inChain) ? 2 : 1); > > Ops[numNodes++] = DAG.getConstant(1, MVT::i32); > > Ops[numNodes++] = DAG.getTargetConstant(0, MVT::i32); > > Op = DAG.getNode(IntNo, dl, EVT::EVT(MVT::i32), Ops, numNodes); > > if (outChain) { > > SDValue mv[2] = {Op, chain}; > > Op = DAG.getMergeValues(mv, 2, dl); > > } > > return Op; > > } > > > > I'm guessing...
2016 Jun 24
2
creating Intrinsic DAG Node
...tting a casting issue, my code is: > > SDValue XXXLowering::LowerFSQRT(SDValue Op, SelectionDAG &DAG) const { > SDLoc DL(Op); > EVT VT = Op.getValueType(); > SDValue LHS = Op.getOperand(0); > > SDValue newNode = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, VT, DAG.getTargetConstantFP(Intrinsic::my_intrinsic, DL, VT), LHS); > return newNode; > } > > The error I'm getting is: Assertion 'isa<X>(Val) && "cast<Ty>() argument of incompatible type!" > > Is this the correct way to add intrinsic dag node? > > Thank...
2009 Jul 03
0
[LLVMdev] Inserting nodes into SelectionDAG (X86)
...); Chain = DAG.getCopyToReg(Chain, DAG.getRegister(X86::EAX, MVT::i32), inc, InFlag); InFlag = Chain.getValue(1); Unfortunately, this becomes movl $42, %eax 1) That is, the ADD-operation is being folded. Is there a way to prevent this from happening? I tried creating the constants wit DAG::getTargetConstant, but it didn't help. 2) The second thing in this code is that InFlag. If I don't place InFlag = SDValue(); there, llc complains about wrong topological ordering. What's that about? Related to that: If I recover the Flag-result from the Chain by InFlag = Chain.getValue(1);, what is i...
2009 Jul 01
3
[LLVMdev] Inserting nodes into SelectionDAG (X86)
On Jul 1, 2009, at 2:22 PMPDT, Dan Gohman wrote: >> Ops.push_back(DAG.getConstant(1, MVT::i32)); >> Chain = DAG.getNode(ISD::ADD, DAG.getVTList(MVT::Other, MVT::i32), >> &Ops[0], Ops.size()); >> >> Isn't that the way how it is supposed to work? > > ADD does not use a chain, so there's no chain operand, or > MVT::Other result for it in an ADD
2016 Oct 29
1
Problems with Inline ASM expressions generated in the back end
...Node<null> (MetaData) with a ch out port SDNode *mdNodeSDNode = CurDAG->getNode(ISD::MDNODE_SDNODE, DL, CurDAG->getVTList(MVT::Other)).getNode(); opsRes.push_back(SDValue(mdNodeSDNode, 0)); SDValue targetConstant = CurDAG->getTargetConstant(1, DL, MVT::i64); SDNode *targetConstantSDNode = targetConstant.getNode(); opsRes.push_back(SDValue(targetConstantSDNode, 0)); SDValue inlineAsm = CurDAG->getNode(ISD::INLINEASM, DL, CurDAG->getVTList(MVT::Other, MVT::Glue),...