Hi, just to summarize a discussion on IRC. The problem is that we produce debug statements for eliminated arguments only in ipa-sra and ipa-split, while we don't do anything for cgraph clones. This is a problem on release branches, too.
It seems we have all the necessary logic, but the callee modification code from ipa-split should be moved to tree_function_versioning (which is used by both ipa-split and cgraph clone mechanizm) and caller modifcation copied to cgraph_edge::redirect_call_stmt_to_callee. I am trying to do that. It seems bit difficult as the caller and callee modifications are tied together and I do not know how chaining of transfomraitons is going to work. Honza