[PATCH] D138333: [CHR] Add a threshold for the code duplication

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 15:07:48 PST 2022


xur added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp:1681
+
+  for (RegInfo &RI : Scope->RegInfos) {
+    const Region *R = RI.R;
----------------
davidxl wrote:
> xur wrote:
> > davidxl wrote:
> > >  is there a need to track all regions in the scope? They seem to have the same dup factor ?
> > The regions in the scope do have the same dup factor. The reason we need a dup factor for each region is that we will accumulate the dup factor for the nested regions (in new function of getRegionDuplicationCount). In addition, most of the scopes has a single region. 
> Can we just count the number of nested regions and multiply it with the dup factor?
That will be the code size increase for this scope?
This seems to be a different metric: here we count the number of clones for this region -- we don't check the size.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138333/new/

https://reviews.llvm.org/D138333



More information about the llvm-commits mailing list