[PATCH] D65464: [LoopFusion] Add ability to fuse guarded loops

Whitney via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 12:38:57 PDT 2019


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:1057
+        if (FC0CmpInst->isIdenticalTo(FC1CmpInst))
+          return true;
+
----------------
kbarton wrote:
> Whitney wrote:
> > what if FC0 guard first successor is FC0 Loop, but FC1 guard second successor is FC1 Loop? 
> Then this check will fail.
> This isn't meant to be exhaustive, but a first pass. If we run into situations where the guards are logically equivalent, and not identical, then we can extend this at that point. 
I am more worry about correctness. When the two compare instructions are the same, but FC0 guard first successor is FC0 Loop, but FC1 guard second successor is FC1 Loop, then we may incorrectly fuse the two loops?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65464/new/

https://reviews.llvm.org/D65464





More information about the llvm-commits mailing list