[LoopInterchange][PR56275] Fix legality with negative dependence vectors
authorCongzhe Cao <congzhe.cao@huawei.com>
Wed, 3 Aug 2022 23:37:30 +0000 (19:37 -0400)
committerCongzheUalberta <congzhecao@gmail.com>
Wed, 3 Aug 2022 23:59:01 +0000 (19:59 -0400)
commit8dc4b2edfad7f097f1628c9db8a6ab2264bb480d
tree957e692c296067c8820083d8c73a4453209ffdd7
parent76be5549318a9e5aa3bdc2b3e0ae8ed5a16bfe59
[LoopInterchange][PR56275] Fix legality with negative dependence vectors

This is the 2nd patch of the two-patch series (D130188, D130189) that
fix PR56275 (https://github.com/llvm/llvm-project/issues/56275) which
is a missed opportunity for loop interchange.

As follow-up on the dependence analysis (DA) patch D130188, this patch
normalizes DA results in loop interchange, such that negative dependence
vectors queried by loop interchange are reversed to be non-negative.

Now all tests in PR56275 can get interchanged. Those tests are added
in lit test as `pr56275.ll`.

Reviewed By: kawashima-fj, bmahjour, Meinersbur, #loopoptwg

Differential Revision: https://reviews.llvm.org/D130189
llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/test/Transforms/LoopInterchange/pr56275.ll [new file with mode: 0644]