[PATCH] D87751: [RDA] Fix getUniqueReachingDef for self loops

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 04:05:38 PDT 2020


SjoerdMeijer added inline comments.


================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:444
   // unique instruction def.
   if (!Incoming.empty() && LocalDef)
     return nullptr;
----------------
nit: after some coding style discussion on the list, I believe it is preferred to put brackets there.


================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:449
+    // Check that the def isn't coming from the same block as it would be
+    // executing after MI. It maybe the only instruction produces the def,
+    // but that doesn't mean it's the only possible value.
----------------
nit: produces -> producing?


================
Comment at: llvm/lib/CodeGen/ReachingDefAnalysis.cpp:453
+  }
+  return nullptr;
 }
----------------
If I am not mistaken, looks like we are actually return nullptr here, except for one case. Thus, can we simplify the above to this below?

  if (Def->getParent() != Parent && Incoming.size() == 1)
    return Def;
  return nullptr;


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

https://reviews.llvm.org/D87751



More information about the llvm-commits mailing list