[all-commits] [llvm/llvm-project] de176d: [SCEV][LV] Invalidate LCSSA exit phis more thoroug...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Nov 17 00:34:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: de176d8c5496d6cf20e82aface98e102c593dbe2
      https://github.com/llvm/llvm-project/commit/de176d8c5496d6cf20e82aface98e102c593dbe2
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-17 (Fri, 17 Nov 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/ScalarEvolution.h
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/pr66616.ll

  Log Message:
  -----------
  [SCEV][LV] Invalidate LCSSA exit phis more thoroughly (#69909)

This an alternative to #69886. The basic problem is that SCEV can look
through trivial LCSSA phis. When the phi node later becomes non-trivial,
we do invalidate it, but this doesn't catch uses that are not covered by
the IR use-def walk, such as those in BECounts.

Fix this by adding a special invalidation method for LCSSA phis, which
will also invalidate all the SCEVUnknowns/SCEVAddRecExprs used by the
LCSSA phi node and defined in the loop.

We should probably also use this invalidation method in other places
that add predecessors to exit blocks, such as loop unrolling and loop
peeling.

Fixes #69097.
Fixes #66616.
Fixes #63970.




More information about the All-commits mailing list