Displaying 20 results from an estimated 30 matches for "replaceuses".
2008 Oct 20
2
[LLVMdev] TableGen Hacking Help
...o MOVSDs and a SHUFPD just fine but it
produces two extra MOVSD instructions.
As far as I can understand things, the problem is that the two MOVSD
instructions are generated by a recursive call to EmitResultCode. Thus isRoot
is false and the result of the call to getTargetNode is not passed to
ReplaceUses. Then when we pop back up and generate the SHUFPD we call
SelectNodeTo which only transforms the immediate node (the vector_shuffle).
It doesn't recurse to replace child nodes.
I tried hacking tblgen to call getTargetNode / ReplaceUses if any node in the
pattern has a chain by changing th...
2010 Feb 27
0
[LLVMdev] Possible SelectionDAG Bug
...your latest patch. In summary, it does expose a
subtle problem. I haven't seen anything that here would lead to
observable misbehavior yet though.
X86GenDAGISel.inc has code like this:
SDValue N1 = N->getOperand(1);
...
SDNode *ResNode = CurDAG->SelectNodeTo(N, ...);
...
ReplaceUses(SDValue(N1.getNode(), 1), SDValue(ResNode, 2));
If N was the only user of N1, and N1 isn't in the new operand list, then
the SelectNodeTo call will make N1 dead. SelectNodeTo will automatically
delete nodes that are made dead by the transformation. This means that
the "from" node in...
2010 Feb 26
2
[LLVMdev] Possible SelectionDAG Bug
On Friday 26 February 2010 10:34:41 David Greene wrote:
> On Friday 26 February 2010 09:55:32 David Greene wrote:
> > In the continuing quest to try to track down problems we're seeing in
> > SelectionDAG, I added the following assert
> > toSelectionDAG::ReplaceAllUsesOfValuesWith:
>
> Here's a patch to add more of these deleted node asserts. They fire
> tons
2008 Sep 10
1
[LLVMdev] ReplaceUses: curious
Hi
I am looking at some of the existing targets to try to understand more
about writing a backend. I was a little puzzled by the use of a method
ReplaceUses in *ISelDAGToDAG.cpp (*= most targets, e.g. ARM, X86..).
I found its definition in the *GenDAGISel.inc file that is
autogenerated from the target description. I can only assume TableGen
emits this method definition for every traget. Is this method
implementation, in some way that I cannot...
2010 Mar 01
2
[LLVMdev] Possible SelectionDAG Bug
...tely observing misbehavior. I know it has something to do
with local changes here but I haven't isolated it yet.
> X86GenDAGISel.inc has code like this:
>
> SDValue N1 = N->getOperand(1);
> ...
> SDNode *ResNode = CurDAG->SelectNodeTo(N, ...);
> ...
> ReplaceUses(SDValue(N1.getNode(), 1), SDValue(ResNode, 2));
>
> If N was the only user of N1, and N1 isn't in the new operand list, then
> the SelectNodeTo call will make N1 dead. SelectNodeTo will automatically
> delete nodes that are made dead by the transformation. This means that
> the &...
2008 Oct 20
0
[LLVMdev] TableGen Hacking Help
On Mon, 2008-10-20 at 11:49 -0500, David Greene wrote:
> I tried hacking tblgen to call getTargetNode / ReplaceUses if any node in the
> pattern has a chain by changing this line in tblgen:
>
> bool InputHasChain = isRoot &&
> NodeHasProperty(Pattern, SDNPHasChain, CGP);
>
> to call PatternHasProperty instead. This does cause tblgen to emit
> getTargetNode / Replac...
2017 Jul 29
2
ISelDAGToDAG breaks node ordering
...)->setMemRefs(MemOp, MemOp + 1);
// Reshuffle LDW's results so that the first two match LOAD's result
// type
SDValue Unpack[] = { SDValue(LDW, 0), SDValue(LDW, 2), SDValue(LDW, 1) };
SDNode* NN = CurDAG->getMergeValues(Unpack, SDLoc(N)).getNode();
ReplaceUses(N, NN);
CurDAG->RemoveDeadNode(N);
With this code, I get correct-looking machine instructions, but the node
order is all botched up. For example, given this input:
SelectionDAG has 8 nodes:
t0: ch = EntryToken
t2: i16,ch = CopyFromReg t0, Register:i16 %vreg0
t5: i16,ch = lo...
2017 Jul 31
0
ISelDAGToDAG breaks node ordering
...] = { SDValue(LDW, 0), SDValue(LDW, 2),
> SDValue(LDW, 1) };
> SDNode* NN = CurDAG->getMergeValues(Unpack, SDLoc(N)).getNode();
Calling getMergeValues in ISelDAGToDAG is a bad idea; there aren't
supposed to be any MERGE_VALUES nodes at that point in the pipeline.
You can call ReplaceUses with SDValues rather than SDNodes.
-Eli
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
2015 Mar 09
2
[LLVMdev] LLVM Backend DAGToDAGISel INTRINSIC
...Operand(4);
SDValue op3 = Node->getOperand(5);
SDValue Ops[]= { op0, op1, op2, op3, Zero, ChainIn };
SDNode *Result =
CurDAG->getMachineNode(Mips::BWT_DROP_RESULT, SDLoc(Node),
ReturnValueVT, Ops);
ReplaceUses(Node, Result);
return std::make_pair(true, Result);
Any clues on how INTRINSIC_W_CHAIN differs from INTRINSIC_VOID?
Thanks,
Ambuj Agrawal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150309...
2008 Sep 12
3
[LLVMdev] Difficulty with reusing DAG nodes.
...Queue(Op2);
unsigned Op;
Op = (Opcode == ISD::UMUL_LOHI ? Nios2::MULxu : Nios2::MULx);
SDNode *Hi = CurDAG->getTargetNode(Op, MVT::Flag, Op1, Op2);
SDNode *Lo = CurDAG->getTargetNode(Nios2::MUL, MVT::Flag, Op1, Op2);
if (!N.getValue(0).use_empty())
ReplaceUses(N.getValue(0), SDValue(Lo,0));
if (!N.getValue(1).use_empty())
ReplaceUses(N.getValue(1), SDValue(Hi,0));
return NULL;
}
The code generator complains:
nios2-elf-ecc:
/home/rich/llvm-trunk-new/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:141:
void llvm::ScheduleDAG::BuildS...
2009 Dec 18
2
[LLVMdev] [PATCH] dbgs() Use
...#39; ') << "== ";
+ dbgs() << std::string(Indent-2, ' ') << "== ";
Node->dump(CurDAG);
- errs() << '\n';
+ dbgs() << '\n';
});
Indent -= 2;
#endif
@@ -1824,9 +1824,9 @@
ReplaceUses(N.getValue(0), Result);
#ifndef NDEBUG
DEBUG({
- errs() << std::string(Indent-2, ' ') << "=> ";
+ dbgs() << std::string(Indent-2, ' ') << "=> ";
Result.getNode()->dump(CurDAG);
- errs(...
2008 Oct 07
2
[LLVMdev] Making Sense of ISel DAG Output
...D2PD instructions and the shuffle mask. SelectNodeTo does an in-place
replacement of the machine-independent SDNode (vector_shuffle)with a
machine-dependent one (the SHUFPD).
When we pop back out to SelectRoot we run into this code:
if (ResNode != Node) {
if (ResNode) {
ReplaceUses(Node, ResNode);
}
if (Node->use_empty()) { // Don't delete EntryToken, etc.
ISelQueueUpdater ISQU(ISelQueue);
CurDAG->RemoveDeadNode(Node, &ISQU);
UpdateQueue(ISQU);
}
}
Since we did an in-placement replacement the first tes...
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
2016 Jun 28
0
Question about changes to 'SelectionDAGISel.h'
...to do the void Select transition in
the version control history - look for commits with "SelectImpl" in the
title. That said, the basic playbook I used for conversions went
something like this:
1. Avoid leaving dangling nodes around in your Select function - places
that currently call ReplaceUses() and then return nullptr often do
that. There are examples of this in r269256.
2. Similarly, some places might replace all uses of a node with a new
one, then return the new node. Just remove the dead node instead.
There was some of this in r269358.
3. Anywhere else where Select returns...
2010 Mar 01
0
[LLVMdev] Possible SelectionDAG Bug
On Mar 1, 2010, at 7:26 AM, David Greene wrote:
>
>> Perhaps this can be fixed by making the code skip the ReplaceUses
>> call in the case where there are no uses to replace. That's not trivial
>> to detect though.
>
> Why not just check the same thing the added asserts check?
You mean ->getOpcode() == ISD::DELETED_NODE? That's not fundamentally
any better, because if your purpose is...
2008 Sep 11
0
[LLVMdev] Tail-calling
On Thu, Sep 11, 2008 at 4:31 PM, Arnold Schwaighofer
<arnold.schwaighofer at gmail.com> wrote:
> Tail calls through function pointers should work.If not please send a testcase.
>
> I just added the two examples from the bug (1392) that calls for true
> tail call support. They work on my machine (-tailcallopt needs to be
> enabled) ;)
>
> That would be commit 56127.
>
2010 Sep 09
2
[LLVMdev] Possible missed optimization? 2.0
...dl,
LoReg,
NVT,
InFlag);
InFlag = Result.getValue(2);
ReplaceUses(SDValue(N, 0), Result);
}
// Copy the high half of the result, if it is needed.
if (!SDValue(N, 1).use_empty())
{
SDValue Result =
CurDAG->getCopyFromReg(CurDAG->getEntryNode(),...
2010 Sep 09
0
[LLVMdev] Possible missed optimization? 2.0
On Sep 9, 2010, at 12:59 PM, Borja Ferrer wrote:
> Hello, i've noticed a new possible missed optimization while testing more trivial code.
> This time it's not a with a xor but with a multiplication instruction and the example is little bit more involved.
>
> C code:
>
> typedef short t;
> t foo(t a, t b)
> {
> t a4 = a*b;
> return a4;
> }
>
2016 Jun 28
2
Question about changes to 'SelectionDAGISel.h'
Thanks Ahmed and also Alex for your replies.
This is more or less what I was realising, but it is a great confidence booster to know that it is the correct way also. I can replace all of my various 'Select*' specialisations with version that use 'ReplaceNode/SelectCode' and return 'void', but what about the places where I currently call 'Select(N)' directly?
2010 Mar 01
2
[LLVMdev] Possible SelectionDAG Bug
On Monday 01 March 2010 13:41:12 Dan Gohman wrote:
> On Mar 1, 2010, at 7:26 AM, David Greene wrote:
> >> Perhaps this can be fixed by making the code skip the ReplaceUses
> >> call in the case where there are no uses to replace. That's not trivial
> >> to detect though.
> >
> > Why not just check the same thing the added asserts check?
>
> You mean ->getOpcode() == ISD::DELETED_NODE? That's not fundamentally
> any b...