[LoopFusion] Add ability to fuse guarded loops
authorKit Barton <kbarton@ca.ibm.com>
Thu, 26 Sep 2019 21:42:45 +0000 (21:42 +0000)
committerKit Barton <kbarton@ca.ibm.com>
Thu, 26 Sep 2019 21:42:45 +0000 (21:42 +0000)
commit50bc61046084b99a9029d3fdf2787c929a044356
tree95e50c6a00b9b66203285c6ab2c0b155b8429df9
parent1128fa09249126449270f807a25a1e40db87d8c5
[LoopFusion] Add ability to fuse guarded loops

Summary:
This patch extends the current capabilities in loop fusion to fuse guarded loops
(as defined in https://reviews.llvm.org/D63885). The patch adds the necessary
safety checks to ensure that it safe to fuse the guarded loops (control flow
equivalent, no intervening code, and same guard conditions). It also provides an
alternative method to perform the actual fusion of guarded loops. The mechanics
to fuse guarded loops are slightly different then fusing non-guarded loops, so I
opted to keep them separate methods. I will be cleaning this up in later
patches, and hope to converge on a single method to fuse both guarded and
non-guarded loops, but for now I think the review will be easier to keep them
separate.

Reviewers: jdoerfert, Meinersbur, dmgreen, etiotto, Whitney

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373018
llvm/lib/Transforms/Scalar/LoopFuse.cpp
llvm/test/Transforms/LoopFusion/guarded.ll [new file with mode: 0644]