It's unfortunate that we have 2 code paths that try to connect function calls with function definitions.
You should be aware that they have are different in their focus.
PureFunctionIdentifier is concerned with detecting any possible side-effects from a function call,
so it is motivated to err on the side of caution by assuming if a call might be connected with a definition, it is connected with that definition.
If it decides a connection exists that really doesn't, that won't lead to incorrect code, just less optimization.
OptimizeCalls and the passes built on it intend to actually modify the call sites and definitions.
If they decide that a call is connected with a definition when it really isn't,
then they will generate broken code.
You should decide which approach makes the most sense for your intended use-case.