[PATCH] D80844: [TRE] Allow accumulator elimination when base case returns non-constant

Layton Kifer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 15:20:05 PDT 2020


laytonio created this revision.
laytonio added reviewers: lattner, nlewycky, Carrot, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Remove the requirement, that when performing accumulator elimination, all other cases must return the same dynamic constant. We can do this by initializing the accumulator with the identity value of the accumulation operation, and inserting an additional operation before any return.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80844

Files:
  llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
  llvm/test/Transforms/TailCallElim/accum_recursion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80844.267369.patch
Type: text/x-patch
Size: 19241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200529/5da2a439/attachment-0001.bin>


More information about the llvm-commits mailing list