[all-commits] [llvm/llvm-project] 264ab1: [LV] Pick vector loop body as insert point for SCE...

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Jul 10 02:37:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 264ab1e2c815728ede5d1fce257abbd04044cc27
      https://github.com/llvm/llvm-project/commit/264ab1e2c815728ede5d1fce257abbd04044cc27
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-07-10 (Fri, 10 Jul 2020)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/pr46525-expander-insertpoint.ll

  Log Message:
  -----------
  [LV] Pick vector loop body as insert point for SCEV expansion.

Currently the DomTree is not kept up to date for additional blocks
generated in the vector loop, for example when vectorizing with
predication. SCEVExpander relies on dominance checks when looking for
existing instructions to re-use and in some cases that can lead to the
expander picking instructions that do not actually dominate their insert
point (e.g. as in PR46525).

Unfortunately keeping the DT up-to-date is a bit tricky, because the CFG
is only patched up after generating code for a block. For now, we can
just use the vector loop header, as this ensures the inserted
instructions dominate all uses in the vector loop. There should be no
noticeable impact on the generated code, as other passes should sink
those instructions, if profitable.

Fixes PR46525.

Reviewers: Ayal, gilr, mkazantsev, dmgreen

Reviewed By: dmgreen

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




More information about the All-commits mailing list