[all-commits] [llvm/llvm-project] f5dd45: [SCEV] Use computeMaxBECountForLT for howManyGreat...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Sep 21 06:24:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5dd45d427bee1a958cfcd35b1155da9391cc4e1
      https://github.com/llvm/llvm-project/commit/f5dd45d427bee1a958cfcd35b1155da9391cc4e1
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-09-21 (Mon, 21 Sep 2026)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolution.h
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/exit-value-nowrap-flags.ll
    M llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-correlated-end.ll
    M llvm/test/Analysis/ScalarEvolution/trip-count13.ll

  Log Message:
  -----------
  [SCEV] Use computeMaxBECountForLT for howManyGreaterThans. (#224863)

Instead of checking for overflow of IV > RHS we can instead check ~IV <
~RHS.

This allows removing canIVOverflowOnGT, by extending canIVOverflowOnLT
and computeMaxBECountForLT to invert the operands if needed, replacing
hand rolled logic in howManyGreaterThans.

This improves results in some cases, because computeMaxBECountForLT
covers some additional cases:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/1371.

This is also the last step in preparation for using howManyLessThans for
howManyGreaterThans.

PR: https://github.com/llvm/llvm-project/pull/224863



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