[PATCH] D86133: [LoopNest] False negative of `arePerfectlyNested` with LCSSA loops

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 07:18:28 PDT 2020


fhahn added inline comments.


================
Comment at: llvm/lib/Analysis/LoopNestAnalysis.cpp:233
+  auto ContainsLCSSAPhi = [](const BasicBlock &B) {
+    return any_of(B, [&](const Instruction &I) {
+      const PHINode *PN = dyn_cast<PHINode>(&I);
----------------
You only need to check phi nodes. There's `B.phis()`. Also, usually it is more common to use `BB` for BasicBlock variables.


================
Comment at: llvm/lib/Analysis/LoopNestAnalysis.cpp:239
+
+  auto IsExtraPhiBlock = [&](const BasicBlock &B) {
+    return all_of(B, [&](const Instruction &I) {
----------------
It might be helpful to add a comment here to specify what 'extra phi block' means.

Also, If you just need to look at PHI nodes, I think you can use `B.phis()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86133



More information about the llvm-commits mailing list