hiraditya added inline comments.
================ Comment at: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:801 + if (Branch->isUnconditional()) + if (ReturnInst *Ret = dyn_cast<ReturnInst>( + Branch->getSuccessor(0)->getFirstNonPHIOrDbg())) ---------------- can we use isa<> here? ================ Comment at: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:816 + if (CallInst *CI = dyn_cast<CallInst>(&*BBI)) + if (!canMoveAboveCall(CI, Inst, AA) && CI->getCalledFunction() != &F) + return false; ---------------- `CI->getCalledFunction() != &F` seems cheaper than `canMoveAboveCall` ================ Comment at: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:840 + + return !llvm::any_of(instructions(F), [&](Instruction &I) { + // Because of PR962, we don't TRE dynamic allocas. ---------------- Do we need to visit all the instructions twice? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82085/new/ https://reviews.llvm.org/D82085 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits