[PATCH] D16984: Don't delete empty preheaders in CodeGenPrepare if it would create a critical edge

George Burgess IV via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 8 12:48:38 PST 2016


george.burgess.iv added a comment.

Sorry, I'm not familiar enough with LLVM to feel comfortable stamping this patch. That said, it looks sane to me, with two nits.

Thanks for doing this! :)


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:372
@@ +371,3 @@
+  SmallVector<Loop *, 16> LoopList(LI->begin(), LI->end());
+  while (!LoopList.empty()) {
+    Loop *L = LoopList.pop_back_val();
----------------
Why can't we just do `for (Loop *L : *LI)`?

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:412
@@ +411,3 @@
+    // Loop preheaders can be good locations to spill registers. If the
+    // preheader is deleeted and we create a critical edge, registers may be
+    // spilled in the loop body instead.
----------------
typo: "deleeted"


http://reviews.llvm.org/D16984





More information about the llvm-commits mailing list