[PATCH] D74691: [Attributor] add some pattern to containsCycle

omar ahmed via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 17:01:52 PST 2020


omarahmed marked an inline comment as done.
omarahmed added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2421
+      }
+    } while (L != L->getParentLoop() && (L = L->getParentLoop()));
   }
----------------
baziotis wrote:
> Sorry but this is unclear to me. Could you explain the reasoning? I'd think that the `while` version is easier to deal with, was there a problem with it?
the while version was making an infinte loop error , I think getParentLoop when there was no parent anymore it returned the same loop and not null so i fixed it by this first check .


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74691





More information about the llvm-commits mailing list