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

Nadav Rotem nrotem at apple.com
Tue Sep 23 17:37:26 PDT 2014


The functionality of the patch looks okay.  Please add a comment that says that non-negative values override the internal default. 


> On Sep 23, 2014, at 11:01 AM, Michael Liao <michael.liao at intel.com> wrote:
> 
> 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