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

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 09:58:51 PDT 2019


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopFuse.cpp:172
+    if (isRotated())
+      GuardBranch = L->getLoopGuardBranch();
 
----------------
kbarton wrote:
> etiotto wrote:
> > It would be better to initialize GuardBranch in the init. list: GuardBranch(L->getLoopGuardBranch()) and have getLoopGuardBranch() return nullptr if the loop guard cannot be identified for whatever reason.
> getLoopGuardBranch only works on rotated loops (it will assert if called on a non-rotated loop). 
FYI https://reviews.llvm.org/D66084 Remove asserts in getLoopGuardBranch.


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