[all-commits] [llvm/llvm-project] e21ee4: [SCEV] Try to re-use pointer LCSSA phis when expan...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Jul 25 07:30:02 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e21ee41be450f849f5247aafa07d7f4c3941bb9d
      https://github.com/llvm/llvm-project/commit/e21ee41be450f849f5247aafa07d7f4c3941bb9d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2025-07-25 (Fri, 25 Jul 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolutionPatternMatch.h
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    A llvm/test/Transforms/LoopIdiom/reuse-lcssa-phi-scev-expansion.ll
    M llvm/test/Transforms/LoopLoadElim/invalidate-laa-after-versioning.ll
    M llvm/test/Transforms/LoopVectorize/reuse-lcssa-phi-scev-expansion.ll
    M llvm/test/Transforms/LoopVersioning/invalidate-laa-after-versioning.ll

  Log Message:
  -----------
  [SCEV] Try to re-use pointer LCSSA phis when expanding SCEVs. (#147824)

Generalize the code added in
https://github.com/llvm/llvm-project/pull/147214 to also support
re-using pointer LCSSA phis when expanding SCEVs with AddRecs.

A common source of integer AddRecs with pointer bases are runtime checks
emitted by LV based on the distance between 2 pointer AddRecs.

This improves codegen in some cases when vectorizing and prevents
regressions with https://github.com/llvm/llvm-project/pull/142309, which
turns some phis into single-entry ones, which SCEV will look through
now (and expand the whole AddRec), whereas before it would have to treat
the LCSSA phi as SCEVUnknown.

Compile-time impact neutral:
https://llvm-compile-time-tracker.com/compare.php?from=fd5fc76c91538871771be2c3be2ca3a5f2dcac31&to=ca5fc2b3d8e6efc09f1624a17fdbfbe909f14eb4&stat=instructions:u

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



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