[all-commits] [llvm/llvm-project] 87afb3: [ScalarEvolution] howManyLessThans infer stride is...

Abhay Kanhere via All-commits all-commits at lists.llvm.org
Mon Sep 14 16:31:10 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 87afb37e3f032af3107dbda6bc0da53460f0407f
      https://github.com/llvm/llvm-project/commit/87afb37e3f032af3107dbda6bc0da53460f0407f
  Author: Abhay Kanhere <a_kanhere at apple.com>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    A llvm/test/Analysis/ScalarEvolution/trip-count-stride-positive-from-guard.ll
    A llvm/test/Transforms/IndVarSimplify/exit-value-guarded-positive-stride.ll

  Log Message:
  -----------
  [ScalarEvolution] howManyLessThans infer stride isPositive from guard (#214014)

Infer Stride is positive from loop guard.
This enables SCEV to compute symbolic-max backedge-taken count for
multi-exit loops.

Motivating example:

  void example(int *p, int n, int stride, int bound) {
if (stride <= 0) __builtin_trap(); // dominating guard => stride > 0
    for (int i = 0; i < n; i += stride) {
if (i > bound) __builtin_trap(); // per-iteration bounds check (2nd
exit)
      p[i] = 0;
    }
  }



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list