HomePhabricator

[LoopInterchange] Fix transformation bugs in loop interchange

Authored by congzhe on Apr 8 2021, 11:53 AM.

Description

[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

Details

Committed
congzheApr 8 2021, 11:58 AM
Reviewer
bmahjour
Differential Revision
D98475: [LoopInterchange] Fix transformation bugs in loop interchange
Parents
rG461b55499981: [RISCV] Add InstAlias for Zbb Zbp and Zbs extension
Branches
Unknown
Tags
Unknown