Displaying 9 results from an estimated 9 matches for "replacenodewith".
2008 Sep 01
2
[LLVMdev] Type Legalizer - Load handling problem
> > That said, it looks like it is done this way because no-one needed
> > anything more. It could easily be changed to handle the case of any
> > number of return values.
> >
> Why not use ReplaceNodeWith ?
I just took a look and it isn't that simple. This code is used
for example to replace
i32 = truncate 0x2374b48
with the first result of
i32,ch = load 0x2356390, 0x2357188, 0x2356b88 <0x236ee80:0> alignment=4
This works fine right now. It fails with ReplaceNodeWith because the
num...
2008 Sep 02
2
[LLVMdev] Type Legalizer - Load handling problem
> I think we will have to go that way since I may want to replace a "store" node also
> (A store node does not produce any results). In this case ReplaceNodeWith () is my only way out.
I agree we should go that way because it is more logical. However
you can also work around the problem by calling ReplaceNodeWith
yourself, and returning an SDValue with null node.
Ciao,
Duncan.
2008 Sep 01
0
[LLVMdev] Type Legalizer - Load handling problem
On Mon, 2008-09-01 at 15:53 +0200, Duncan Sands wrote:
> > > That said, it looks like it is done this way because no-one needed
> > > anything more. It could easily be changed to handle the case of any
> > > number of return values.
> > >
> > Why not use ReplaceNodeWith ?
>
> I just took a look and it isn't that simple. This code is used
> for example to replace
> i32 = truncate 0x2374b48
> with the first result of
> i32,ch = load 0x2356390, 0x2357188, 0x2356b88 <0x236ee80:0> alignment=4
> This works fine right now. It fails w...
2008 Sep 03
0
[LLVMdev] Type Legalizer - Load handling problem
On Tue, 2008-09-02 at 09:25 +0200, Duncan Sands wrote:
> > I think we will have to go that way since I may want to replace a "store" node also
> > (A store node does not produce any results). In this case ReplaceNodeWith () is my only way out.
>
> I agree we should go that way because it is more logical. However
> you can also work around the problem by calling ReplaceNodeWith
> yourself, and returning an SDValue with null node.
>
How do we access ReplaceNodeWith in TLI ?
- Sanjiv
> Ciao,
>...
2008 Aug 29
2
[LLVMdev] Type Legalizer - Load handling problem
> > LOAD node has two values but the assertion checks N->getNumValues() == 1
> > which is not letting us change load operation.
>
> Yup, in this case you need to return an SDValue with null Val field,
> and take care of replacing values yourself.
That said, it looks like it is done this way because no-one needed
anything more. It could easily be changed to handle the
2008 Aug 29
0
[LLVMdev] Type Legalizer - Load handling problem
...eed to return an SDValue with null Val field,
> > and take care of replacing values yourself.
>
> That said, it looks like it is done this way because no-one needed
> anything more. It could easily be changed to handle the case of any
> number of return values.
>
Why not use ReplaceNodeWith ?
- Sanjiv
2008 Aug 19
2
[LLVMdev] Type Legalizer - Load handling problem
On Mon, 2008-08-18 at 08:50 -0700, Eli Friedman wrote:
> On Mon, Aug 18, 2008 at 6:31 AM, <Sachin.Punyani at microchip.com> wrote:
> > assert(Res.getValueType() == N->getValueType(0) && N->getNumValues() == 1 &&
> > "Invalid operand expansion");
> >
> > LOAD node has two values but the assertion checks N->getNumValues() == 1
>
2008 Aug 19
0
[LLVMdev] Type Legalizer - Load handling problem
...With(SDValue(N, 0), Res);
>
> also looks incorrect, because the back-end lowered load will return two
> values as well.
Oh, I see what you mean! Sorry, I missed the issue originally.
Definitely looks like a bug. I think the correct solution is that if
custom legalization returns a node, ReplaceNodeWith should be used
rather than the existing codepath.
-Eli
2008 Aug 19
1
[LLVMdev] Type Legalizer - Load handling problem
...gt;
>> also looks incorrect, because the back-end lowered load will return two
>> values as well.
>
> Oh, I see what you mean! Sorry, I missed the issue originally.
> Definitely looks like a bug. I think the correct solution is that if
> custom legalization returns a node, ReplaceNodeWith should be used
> rather than the existing codepath.
Actually, it should probably be using TLI.ReplaceNodeResults as well,
like the way PromoteIntegerResult calls into the target for custom
legalization.
-Eli