[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?

Tim Northover t.p.northover at gmail.com
Sat Aug 9 08:43:50 PDT 2014


> I think this is incorrect since the use_iterator is defined as:
>
> `typedef value_use_iterator<User> use_iterator;`
>
> and indeed `ui->getUser();` is not a callable function on a User. What am I
> missing?

Ah, looks like this has changed this year. What I said applies to
trunk; you may be right there about 3.4 or earlier (looks plausible
from the key commit).

Another problem might be that User::replaceUsesOfWith only works in
limited situations if the User is a Constant. But I'd expect that to
fail with an assertion (assuming your LLVM has been built with
assertions enabled, of course).

Do you have (preferably as simple as possible) IR module that shows
the replacement failure?

Cheers.

Tim.



More information about the llvm-dev mailing list