Currently we can only eliminate call return pairs that either return the result of the call or a dynamic constant. This patch removes that limitation.
Can you add a few testcases for eliminating multiple tail calls?
Maybe describe what specific instructions RetPN and RetKnownPN actually refer to?
Might as well use UndefValue::get here?
You can use dropAllReferences() to clear out the operands of an instruction before you erase it.