[PATCH] D123230: [UnifyLoopExits] Reduce number of guard blocks

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 00:54:47 PDT 2022


critson added a comment.

Unfortunately this can breaks reconvergence in some edge cases.
This occurs because exits in an inner loop may end up no longer reconvergencing with exits in an outer loop.
I am trying to clean up on a test case based on a Vulkan CTS test failure this causes.

I believe the solution is to test that all predecessors of the common successor are members of the set of exits.
If not then it indicates the common successor is part of a reconvergence structure shared by inner and outer loop exits and this optimization cannot be used.

e.g.

  for (auto CS : CommonSuccs) {
      // ...
  
      if (!llvm::all_of(predecessors(CB), [Exits](auto Pred) {return Exits.contains(Pred);}))
        continue;
      
      // ...
    }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123230



More information about the llvm-commits mailing list