[PATCH] D11955: [WinEHPrepare] Update demotion logic

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 14:46:49 PDT 2015


majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.

Thanks for working on this!

LGTM with nits applied.


================
Comment at: lib/CodeGen/WinEHPrepare.cpp:3230-3231
@@ +3229,4 @@
+    std::set<BasicBlock *> &ColorsForUsingBB = BlockColors[UsingBB];
+    if (std::includes(ColorsForBB.begin(), ColorsForBB.end(),
+      ColorsForUsingBB.begin(), ColorsForUsingBB.end()))
+      continue;
----------------
This looks a little funny, could you run clang-format over it?

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:3262
@@ +3261,3 @@
+    } else {
+      assert(isa<Instruction>(V));
+      InsertPt = cast<Instruction>(V);
----------------
This assert shouldn't be necessary, `cast` will do that for you.

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:3278-3280
@@ +3277,5 @@
+  if (!SpillSlot)
+    SpillSlot = new AllocaInst(V->getType(), nullptr,
+    Twine(V->getName(), ".wineh.spillslot"),
+    F.getEntryBlock().begin());
+
----------------
Could you reformat this with clang-format.

================
Comment at: lib/CodeGen/WinEHPrepare.cpp:3297-3298
@@ +3296,4 @@
+    if (!Load)
+      Load = new LoadInst(SpillSlot, Twine(V->getName(), ".wineh.reload"),
+      /*Volatile=*/false, IncomingBlock->getTerminator());
+
----------------
This should be formatted as well.


http://reviews.llvm.org/D11955





More information about the llvm-commits mailing list