[PATCH] D44524: Add an analysis printer for must execute reasoning

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 10:14:31 PDT 2018


anna added inline comments.


================
Comment at: lib/Analysis/MustExecute.cpp:87
+    OS << "\t(mustexec in ";
+    bool first = true;
+    for (const Loop *L : MustExec.lookup(V)) {
----------------
reames wrote:
> anna wrote:
> > Perhaps rename this to exactlyOneLoop and  define that as  `MustExec[V]->size()  == 1`  
> Er, what?  I don't understand your comment.  The "first" variable is simply being used to join a set of strings with a comma in between.  
What I meant is we can do something like this instead of using the first variable:
```
const bool exactlyOneLoop = MustExec[V]->size()  == 1;
for (const Loop *L : MustExec.lookup(V)) {
      OS << L->getHeader()->getName();
      if (!ExactlyOneLoop)
          OS << ", ";
}
```



Repository:
  rL LLVM

https://reviews.llvm.org/D44524





More information about the llvm-commits mailing list