[LLVMdev] Type Legalizer - Load handling problem

Duncan Sands baldrick at free.fr
Mon Sep 1 06:53:24 PDT 2008


> > 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.



More information about the llvm-dev mailing list