[llvm] [CGP] Consider arguments and ret values in `dupRetToEnableTailCallOpts` (PR #76613)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 12:44:16 PST 2024


================
@@ -2580,7 +2611,7 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB,
     }
 
     PN = dyn_cast<PHINode>(V);
-    if (!PN)
+    if (!PN && !isa<Argument>(V) && !isa<CallInst>(V))
----------------
nikic wrote:

Now that everything is appropriately restricted below, do we actually still need this check? I don't really get why we would want to limit this to args/returns in particular.

https://github.com/llvm/llvm-project/pull/76613


More information about the llvm-commits mailing list