I want to replace "function A" call to "function B" call. Currently, I've inserted "function B", I think ReplaceInstWithInst() may help, however, I don't know how to locate "function A". How should I do?
You can access all the functions in a module by using mod->getFunction("functionA");
, as described here.