[all-commits] [llvm/llvm-project] 623c4a: [LoopVersioning] Invalidate SCEV for phi if new va...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Sep 23 03:54:05 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 623c4a7a55f716b96070a5c2f83fe0096cb38d38
      https://github.com/llvm/llvm-project/commit/623c4a7a55f716b96070a5c2f83fe0096cb38d38
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-09-23 (Fri, 23 Sep 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/LoopVersioning.cpp
    A llvm/test/Transforms/LoopLoadElim/versioning-scev-invalidation.ll

  Log Message:
  -----------
  [LoopVersioning] Invalidate SCEV for phi if new values are added.

After 20d798bd47ec5191d, SCEV looks through PHIs with a single incoming
value. This means adding a new incoming value may change the SCEV for a
phi. Add missing invalidation when an existing PHI is reused during
LoopVersioning. New incoming values will be added later from the
versioned loop.

Similar issues have been fixed by also adding missing invalidation.

Fixes #57825.

Note that the test case unfortunately requires running loop-vectorize
followed by loop-load-elimination, which does the actual versioning. I
don't think it is possible to reproduce the failure without that
combination.




More information about the All-commits mailing list