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

CongzheUalberta via All-commits all-commits at lists.llvm.org
Wed Apr 7 17:57:14 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5645ea65f0dfdef2ae9c74075cc4b44f05dcb82
      https://github.com/llvm/llvm-project/commit/f5645ea65f0dfdef2ae9c74075cc4b44f05dcb82
  Author: CongzheUalberta <congzhecao at gmail.com>
  Date:   2021-04-07 (Wed, 07 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
`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 (new) 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