[PATCH] D16382: Add LoopSimplifyCFG pass

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 18:32:16 PST 2016


sanjoy added a comment.

Minor drop by comments inline.


================
Comment at: lib/Transforms/Scalar/LoopSimplifyCFG.cpp:37
@@ +36,3 @@
+namespace {
+  class LoopSimplifyCFG : public LoopPass {
+  public:
----------------
Minor: convention is to not indent namespaces: http://llvm.org/docs/CodingStandards.html#namespace-indentation

Also, why not make this a struct?

================
Comment at: lib/Transforms/Scalar/LoopSimplifyCFG.cpp:90
@@ +89,3 @@
+
+  bool changed = false;
+  DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
----------------
Minor: coding style is to name this `Changed`.

================
Comment at: lib/Transforms/Scalar/LoopSimplifyCFG.cpp:105
@@ +104,3 @@
+      L->moveToHeader(Succ);
+    LI->removeBlock(Pred);
+    MergeBasicBlockIntoOnlyPred(Succ, DT);
----------------
Won't this invalidate `E`?


Repository:
  rL LLVM

http://reviews.llvm.org/D16382





More information about the llvm-commits mailing list