@@ -738,6 +738,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
738
738
self .async_sampler = False
739
739
self .safepoint_sampler = False
740
740
self .profile_inference_feature_extraction = False
741
+ self .profile_inference_call_count = False
741
742
self .force_profile_inference = False
742
743
self .profile_inference_debug = False
743
744
self .analysis_context_sensitivity = None
@@ -813,6 +814,8 @@ def config_name(self):
813
814
config += ["adopted-jdk-pgo" ]
814
815
if self .profile_inference_feature_extraction is True :
815
816
config += ["profile-inference-feature-extraction" ]
817
+ if self .profile_inference_call_count is True :
818
+ config += ["profile-inference-call-count" ]
816
819
if self .pgo_instrumentation is True and self .force_profile_inference is True :
817
820
if self .pgo_exclude_conditional is True :
818
821
config += ["profile-inference-pgo" ]
@@ -847,7 +850,7 @@ def _configure_from_name(self, config_name):
847
850
r'(?P<future_defaults_all>future-defaults-all-)?(?P<gate>gate-)?(?P<upx>upx-)?(?P<quickbuild>quickbuild-)?(?P<layered>layered-)?(?P<graalos>graalos-)?(?P<gc>g1gc-)?' \
848
851
r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
849
852
r'(?P<analysis_context_sensitivity>insens-|allocsens-|1obj-|2obj1h-|3obj2h-|4obj3h-)?(?P<jdk_profiles>jdk-profiles-collect-|adopted-jdk-pgo-)?' \
850
- r'(?P<profile_inference>profile-inference-feature-extraction-|profile-inference-pgo-|profile-inference-debug-)?(?P<sampler>safepoint-sampler-|async-sampler-)?(?P<optimization_level>O0-|O1-|O2-|O3-|Os-)?(default-)?(?P<edition>ce-|ee-)?$'
853
+ r'(?P<profile_inference>profile-inference-feature-extraction-|profile-inference-call-count-|profile-inference- pgo-|profile-inference-debug-)?(?P<sampler>safepoint-sampler-|async-sampler-)?(?P<optimization_level>O0-|O1-|O2-|O3-|Os-)?(default-)?(?P<edition>ce-|ee-)?$'
851
854
852
855
mx .logv (f"== Registering configuration: { config_name } " )
853
856
match_name = f"{ config_name } -" # adding trailing dash to simplify the regex
@@ -970,6 +973,8 @@ def generate_profiling_package_prefixes():
970
973
if profile_inference_config == 'profile-inference-feature-extraction' :
971
974
self .profile_inference_feature_extraction = True
972
975
self .pgo_instrumentation = True # extract code features
976
+ elif profile_inference_config == 'profile-inference-call-count' :
977
+ self .profile_inference_call_count = True
973
978
elif profile_inference_config == "profile-inference-pgo" :
974
979
# We need to run instrumentation as the profile-inference-pgo JVM config requires dynamically collected
975
980
# profiles to combine with the ML-inferred branch probabilities.
@@ -1558,6 +1563,8 @@ def run_stage_image(self):
1558
1563
mx .warn (
1559
1564
"To dump the profile inference features to a specific location, please set the '{}' flag." .format (
1560
1565
dump_file_flag ))
1566
+ elif self .profile_inference_call_count :
1567
+ ml_args = svm_experimental_options (['-H:+MLCallCountProfileInference' ])
1561
1568
elif self .force_profile_inference :
1562
1569
ml_args = svm_experimental_options (['-H:+MLGraphFeaturesExtraction' , '-H:+MLProfileInference' ])
1563
1570
else :
0 commit comments