[llvm] [CGP] Do not fold ret value if constant in `dupRetToEnableTailCallOpts` (PR #76613)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 30 06:47:14 PST 2023


================
@@ -2532,7 +2532,8 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB,
     }
 
     PN = dyn_cast<PHINode>(V);
-    if (!PN)
+
+    if (isa<Constant>(V))
----------------
antoniofrighetto wrote:

May be worth it to anticipate before the `dyn_cast<BitCastInst>`?

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


More information about the llvm-commits mailing list