[llvm-branch-commits] [SCEV] Preserve LCSSA when reusing dominating variable (PR #192831)

Nikita Popov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 22 12:47:03 PDT 2026


================
@@ -1237,6 +1237,8 @@ SCEVExpander::expandAddRecExprLiterally(SCEVUseT<const SCEVAddRecExpr *> S) {
   // We have decided to reuse an induction variable of a dominating loop. Apply
   // truncation and/or inversion of the step.
   if (TruncTy) {
+    if ((TruncTy != Result->getType()) || InvertStep)
----------------
nikic wrote:

```suggestion
    if (TruncTy != Result->getType() || InvertStep)
```

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


More information about the llvm-branch-commits mailing list