> > 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 case of any number of return values. Ciao, Duncan.
On Fri, 2008-08-29 at 17:28 +0200, Duncan Sands wrote:> > > 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 case of any > number of return values. >Why not use ReplaceNodeWith ? - Sanjiv
> > 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 number of results differs. It could be made to work by using a MergeValues node to produce a node with one result out of the load, and similarly for the other examples of this kind of thing. Ciao, Duncan.