The check logic for TCO is scattered in two functions: IsEligibleForTailCallOptimization_64SVR4() IsEligibleForTailCallOptimization(), and serves instruction selection phase only at this moment.
There is one scenario (D131953) during transformation, we would like to determine if tailcall can be guaranteed or not. Existing logic cannot be directly reused due to dependency on DAG and SDValue etc.
This patch aims to refactor existing logic to export an API for TCO eligible query before instruction selection phase.
nit: no need for the two else.