[all-commits] [llvm/llvm-project] 5cbb9f: [LCSSA] Don't invalidate SCEV

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue May 2 01:02:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cbb9f7a58d98ba432c6ddeefa581f6fc521315c
      https://github.com/llvm/llvm-project/commit/5cbb9f7a58d98ba432c6ddeefa581f6fc521315c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-05-02 (Tue, 02 May 2023)

  Changed paths:
    M llvm/lib/Transforms/Utils/LCSSA.cpp

  Log Message:
  -----------
  [LCSSA] Don't invalidate SCEV

LCSSA currently invalidates SCEV for all instructions for which
LCSSA phi nodes are created. This used to be necessary, because
SCEV has historically tried to maintain LCSSA form as well. As
such, some SCEV uses of the value would have to become uses of
the phi node instead.

However, nowadays SCEV itself no longer maintains LCSSA form.
The SCEV of on LCSSA phi node will be the same as the SCEV of its
argument. LCSSA is instead maintained in the SCEVExpander.

As such, I believe it is no longer necessary to perform any SCEV
invalidation during LCSSA construction.

After this patch the ScalarEvolution argument to the LCSSA utilities
is no longer necessary -- I'll remove it in a followup NFC patch to
keep this patch more concise.

Differential Revision: https://reviews.llvm.org/D149435




More information about the All-commits mailing list