[llvm-commits] [llvm] r52537 - /llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp

Matthijs Kooijman matthijs at stdin.nl
Wed Jul 2 09:16:24 PDT 2008


Hi Chris,

> > Don't let DeadArgElimination change the return type ({} into void  
> > and {T}
> > into T) when no return values are actually dead.
> Out of curiosity, why not?  {x} -> x would eliminate extractvalue  
> instructions, so it seems that it would reduce the size of the IR.
I just tried a bit to implement this, but this poses problems again when the
result is used as is again. For example:
 %S = call { i32 } @foo()
 call void @bar({ i32 } %S)

here the result of @foo was correctly marked live, but the code would still
try to turn it into call i32 @foo() and then be surprised that %S was used by
other stuff than extractvalues. I can solve this by, in addition to a list
of Functions that really can't be modified at all, keeping a list of Functions
whose return values really can't be modified at all (which is slightly
different from having all return values live only for functions returning a
struct with a single element, or perhaps for zero elements as well).

However, I'm not really sure this is worth the effort. Perhaps this should be
done in a different pass, really?

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080702/583aad70/attachment.sig>


More information about the llvm-commits mailing list