[all-commits] [llvm/llvm-project] 829c1b: [LoopInterchange] fix tightlyNested() in LoopInter...

CongzheUalberta via All-commits all-commits at lists.llvm.org
Wed Mar 24 12:50:13 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 829c1b644390e35bd179c06f45223f778dfc5ab2
      https://github.com/llvm/llvm-project/commit/829c1b644390e35bd179c06f45223f778dfc5ab2
  Author: Congzhe Cao <congzhe.cao at huawei.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    M llvm/test/Transforms/LoopInterchange/not-interchanged-tightly-nested.ll

  Log Message:
  -----------
  [LoopInterchange] fix tightlyNested() in LoopInterchange legality

This is yet another attempt to fix tightlyNested().

Add checks in tightlyNested() for the inner loop exit block,
such that 1) if there is control-flow divergence in between the inner
loop exit block and the outer loop latch, or 2) if the inner loop exit
block contains unsafe instructions, tightlyNested() returns false.

The reasoning behind is that after interchange, the original inner loop
exit block, which was part of the outer loop, would be put into the new
inner loop, and will be executed different number of times before and
after interchange. Thus it should be dealt with appropriately.

Reviewed By: Whitney

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




More information about the All-commits mailing list