HomePhabricator

[CodeGenPrepare] Handle ExtractValueInst in dupRetToEnableTailCallOpts

Authored by Carrot on Mar 4 2020, 11:10 AM.

Description

[CodeGenPrepare] Handle ExtractValueInst in dupRetToEnableTailCallOpts

As the test case shows if there is an ExtractValueInst in the Ret block, function dupRetToEnableTailCallOpts can't duplicate it into the block containing call. So later no tail call is generated in CodeGen.

This patch adds the ExtractValueInst handling code in function dupRetToEnableTailCallOpts and FoldReturnIntoUncondBranch, and later tail call can be generated for this case.

Differential Revision: https://reviews.llvm.org/D74242