[PATCH] D73641: [LoopFusion] Move instructions from FC1.GuardBlock to FC0.GuardBlock and from FC0.ExitBlock to FC1.ExitBlock when proven safe.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 15:29:46 PST 2020


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:776
             continue;
           }
 
----------------
Whitney wrote:
> jdoerfert wrote:
> > What happens now if there is a FC1 guard branch with non-movable instructions but no fc0 guard branch. I think we now miss that case and do sth? Could you add a test if we don't have one?
> I think that's not allowed in https://reviews.llvm.org/D71569.
Fair, then you didn't need to change `FC1->GuardBranch &&` into `FC0->GuardBranch && FC1->GuardBranch &&`, right? At least that is what confused me here.
Maybe we do an outer `if (FC0->GuardBranch) {...}` and an assertion that both are set or none is? That makes the two conditionals also simpler as they only check `isSafeToMoveBefore`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73641





More information about the llvm-commits mailing list