[all-commits] [llvm/llvm-project] 463574: [SCEV] Try to re-use existing LCSSA phis when expa...

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Jul 17 07:48:16 PDT 2025


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

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/test/Transforms/LoopVectorize/reuse-lcssa-phi-scev-expansion.ll

  Log Message:
  -----------
  [SCEV] Try to re-use existing LCSSA phis when expanding SCEVAddRecExpr. (#147214)

If an AddRec is expanded outside a loop with a single exit block, check
if any of the (lcssa) phi nodes in the exit block match the AddRec. If
that's the case, simply use the existing lcssa phi.

This can reduce the number of instruction created for SCEV expansions,
mainly for runtime checks generated by the loop vectorizer.

Compile-time impact should be mostly neutral

https://llvm-compile-time-tracker.com/compare.php?from=48c7a3187f9831304a38df9bdb3b4d5bf6b6b1a2&to=cf9d039a7b0db5d0d912e0e2c01b19c2a653273a&stat=instructions:u

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



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