[PATCH] D22817: Utility to print all the basic blocks of a loop.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 11:07:43 PDT 2016


sanjoy requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: llvm/include/llvm/Analysis/LoopInfoImpl.h:339
@@ +338,3 @@
+template<class BlockT, class LoopT>
+void LoopBase<BlockT, LoopT>::printVerbose(raw_ostream &OS,
+                                           unsigned Depth) const {
----------------
Not sure if this needs to be a completely separate method -- why not just pass in a `verbose` flag to `print`?

================
Comment at: llvm/include/llvm/Analysis/LoopInfoImpl.h:349
@@ +348,3 @@
+    if (BB == H) OS << "<header>\n";
+    if (BB == L) OS << "<latch>\n";
+    if (isLoopExiting(BB)) OS << "<exiting>\n";
----------------
Hm, just noticed that this is misleading both here and in the print method above -- if the loop has multiple latches, we won't tag any blocks as `<latch>`.  This should be fixed (we need a `isLoopLatch` helper like we have `isLoopExiting`).  @hiraditya - do you mind fixing this in a later change?  If you won't be able to get to it, please let me know and I'll do it.


https://reviews.llvm.org/D22817





More information about the llvm-commits mailing list