[PATCH] D28921: [PM] Port LoopSink to the new pass manager.

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 14:58:56 PST 2017

sanjoy added inline comments.

Comment at: lib/Transforms/Scalar/LoopSink.cpp:317
+  SmallVector<Loop *, 4> PreOrderLoops, PreOrderWorklist;
+  for (Loop *RootL : LI) {
+    assert(PreOrderWorklist.empty() &&
Don't you need to traverse `LI` in reverse?  That way you'll push to `PreOrderLoops` in program order, and pop from it in reverse program order (which is what the pass expects).

Comment at: lib/Transforms/Scalar/LoopSink.cpp:345
+  PA.preserve<GlobalsAA>();
+  PA.preserve<SCEVAA>();
+  return PA;
Didn't you invalidate SCEV?  Can you still preserve SCEVAA?


More information about the llvm-commits mailing list