[PATCH] Allow BB duplication threshold to be adjusted through JumpThreading's ctor

Michael Liao michael.liao at intel.com
Tue Sep 23 11:01:53 PDT 2014


PING again

================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:50
@@ -49,3 +49,3 @@
           cl::desc("Max block size to duplicate for jump threading"),
           cl::init(6), cl::Hidden);
 
----------------
spatel wrote:
> I have no opinion about the functionality of this patch, but how about giving a name to that magic '6'...like:
>    static unsigned BBDuplicateThresholdDefault = 6;
> 
> Then you can use that constant as the default parameter assignment, and you don't have to introduce yet another magic number (-1) and cast signed to unsigned.
'-1' here is used to tell whether a value other that default threshold is specified or not. However, that default threshold would be changed through command line option. Adding a name for that magic '6' and using it as default parameter does work correctly when that default threshold is changed through command option but no value is specified through pass creator.

http://reviews.llvm.org/D5444






More information about the llvm-commits mailing list