[llvm] [TailRecElim] Introduce support for shift accumulator optimization (PR #181331)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 06:49:38 PDT 2026


================
@@ -436,6 +524,10 @@ class TailRecursionEliminator {
   // The instruction doing the accumulating.
   Instruction *AccumulatorRecursionInstr = nullptr;
 
+  // The base case return value. It exists only if the accumulator
+  // operation is pseudo-associative.
+  Constant *AccumulatorInitialValue = nullptr;
----------------
antoniofrighetto wrote:

```suggestion
  Constant *AccumulatorInitialValue = nullptr;
```

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


More information about the llvm-commits mailing list