[all-commits] [llvm/llvm-project] 914374: [SCEV] Try to push op into ZExt: C * zext (A + B) ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Aug 26 11:32:13 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 914374624f19eb6c43bc272a4f600975f80e011a
      https://github.com/llvm/llvm-project/commit/914374624f19eb6c43bc272a4f600975f80e011a
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
    M llvm/test/Transforms/IndVarSimplify/rewrite-loop-exit-values-phi.ll
    M llvm/test/Transforms/LoopIdiom/X86/memset-size-compute.ll
    M llvm/test/Transforms/LoopIdiom/add-nsw-zext-fold.ll
    M llvm/test/Transforms/LoopVectorize/runtime-check.ll

  Log Message:
  -----------
  [SCEV] Try to push op into ZExt: C * zext (A + B) -> zext (A*C + B*C) (#155300)

Try to push constant multiply operand into a ZExt containing an add, if
possible. In general we are trying to push down ops through ZExt if
possible. This is similar to
https://github.com/llvm/llvm-project/pull/151227 which did the same for
additions.

For now this is restricted to adds with a constant operand, which is
similar to some of the logic above.

This enables some additional simplifications.

Alive2 Proof: https://alive2.llvm.org/ce/z/97pbSL

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



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