[PATCH] D13070: [SimplifyCFG] Speculatively flatten CFG based on profiling metadata
hfinkel@anl.gov via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 13:22:08 PDT 2015
hfinkel added inline comments.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2353
@@ +2352,3 @@
+/// path. This is code size neutral, but makes it dynamically more expensive
+/// to fail either check. As such, we only want to do this if both checks are
+/// expected to essentially never fail.
----------------
either check -> any of the checks
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2382
@@ +2381,3 @@
+ return false;
+ return ProbTrue > ProbFalse * 100;
+ };
----------------
I'd rather that this 100 ratio be a command-line parameter for easier experimentation.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:2403
@@ +2402,3 @@
+ // Only flatten relatively small BBs to avoid making the bad case terrible
+ if (SpeculationCost > 10 || isa<CallInst>(I) || isa<InvokeInst>(I))
+ return false;
----------------
10 should be a command-line parameter too.
http://reviews.llvm.org/D13070
More information about the llvm-commits
mailing list