[all-commits] [llvm/llvm-project] da58e6: [LoopFusion] Move instructions from FC1.Preheader ...

whitneywhtsang via All-commits all-commits at lists.llvm.org
Wed Jan 29 07:06:21 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: da58e68fdf1ba9efd833f8b46216a6642a139178
      https://github.com/llvm/llvm-project/commit/da58e68fdf1ba9efd833f8b46216a6642a139178
  Author: Whitney Tsang <whitneyt at ca.ibm.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
    M llvm/lib/Transforms/Scalar/LoopFuse.cpp
    M llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
    M llvm/test/Transforms/LoopFusion/diagnostics_missed.ll
    M llvm/test/Transforms/LoopFusion/guarded.ll
    M llvm/test/Transforms/LoopFusion/simple.ll

  Log Message:
  -----------
  [LoopFusion] Move instructions from FC1.Preheader to FC0.Preheader when
proven safe.

Summary:
Currently LoopFusion give up when the second loop nest preheader is
not empty. For example:

for (int i = 0; i < 100; ++i) {}
x+=1;
for (int i = 0; i < 100; ++i) {}
The above example should be safe to fuse.
This PR moves instructions in FC1 preheader (e.g. x+=1; ) to
FC0 preheader, which then LoopFusion is able to fuse them.
Reviewer: kbarton, Meinersbur, jdoerfert, dmgreen, fhahn, hfinkel,
bmahjour, etiotto
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D71821




More information about the All-commits mailing list