[PATCH] D15213: [SimplifyCFG] allow speculation of exactly one expensive instruction (PR24818)

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 10:25:50 PST 2015


jmolloy requested changes to this revision.
jmolloy added a comment.
This revision now requires changes to proceed.

Hi Sanjay,

Just a couple of comments.

James


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:307
@@ -301,1 +306,3 @@
+  // enabled further IR optimizations.
+  if (Cost > CostRemaining && (AggressiveInsts->size() || Depth))
     return false;
----------------
I think !empty() is a quicker predicate than size(). I also think as Depth is an integer and you're using it in integer context, "Depth > 0" would be more explanatory.

I think this is the sort of heuristic that it would be good to get as a cl::opt.


http://reviews.llvm.org/D15213





More information about the llvm-commits mailing list