[llvm-dev] What constitutes a replaceable use?

Rodney M. Bates via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 9 11:18:03 PDT 2017


I am creating a temporary ValueRef (call it %temp) that I need to build uses of before
there is enough information  tocreate the value it really needs to be, (call it %real).
After I create %real, I am calling LLVMReplaceAllUsesWith(%temp, %real).

Uses that were created by passing %temp as one of the actual parameters to LLVMBuildCall
are getting replaced.  A use created by building a bitcast of %temp, then passing
that to the source value of a store are not.

Any advice on how to get the replace to happen?

This is llvm 3.6.1, using the Core C bindings for building llvm IR.  Also, the
values I have tried for %temp are constants, just to avoid having unnecessary
stuff remaining.


-- 
Rodney Bates
rodney.m.bates at acm.org


More information about the llvm-dev mailing list