[all-commits] [llvm/llvm-project] ce2db9: [LoopInterchange] Fix transformation bugs in loop ...

CongzheUalberta via All-commits all-commits at lists.llvm.org
Thu Apr 8 11:59:55 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ce2db9005d701ffbd786f395ff8065ca9fdadea9
      https://github.com/llvm/llvm-project/commit/ce2db9005d701ffbd786f395ff8065ca9fdadea9
  Author: Congzhe Cao <congzhe.cao at huawei.com>
  Date:   2021-04-08 (Thu, 08 Apr 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopInterchange.cpp
    M llvm/test/Transforms/LoopInterchange/lcssa-preheader.ll
    A llvm/test/Transforms/LoopInterchange/outer-header-jump-to-inner-latch.ll

  Log Message:
  -----------
  [LoopInterchange] Fix transformation bugs in loop interchange

After loop interchange, the (old) outer loop header should not jump to
the `LoopExit`. Note that the old outer loop becomes the new inner loop
after interchange. If we branched to `LoopExit` then after interchange
we would jump directly from the (new) inner loop header to `LoopExit`
without executing the rest of outer loop.

This patch modifies adjustLoopBranches() such that the old outer
loop header (which becomes the new inner loop header) jumps to the
old inner loop latch which becomes the new outer loop latch after
interchange.

Reviewed By: bmahjour

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




More information about the All-commits mailing list