[PATCH] D14308: [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
Chen Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 10 14:51:38 PST 2015
chenli added inline comments.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:3221
@@ +3220,3 @@
+
+ // If RI->getValue() is a landing pad, check if the first instruction is
+ // the same landing pad that caused control to branch here. If RI->getValue
----------------
reames wrote:
> Given how divergent the two cases have gotten, I think we should split the two cases. The code duplication is relatively minor compared to the simplification of the complexity.
Will do.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:3278
@@ +3277,3 @@
+ // to remove them all.
+ while (PhiLPInst && PhiLPInst->getBasicBlockIndex(TrivialBB) != -1) {
+ BB->removePredecessor(TrivialBB, true);
----------------
reames wrote:
> I think this can be more clearly written as:
> if (PhiLPInst)
> while (PhiLPInst->getBasicBlockIndex(TrivialBB) != -1)
> BB->removePredecessor(TrivialBB, false);
>
> Right?
Yes, but this won't exist after we separate the two cases :)
http://reviews.llvm.org/D14308
More information about the llvm-commits
mailing list