[PATCH] D82085: [TRE] allow TRE for non-capturing calls.
Aditya Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 22 16:07:56 PDT 2020
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
More information about the cfe-commits
mailing list