@@ -738,6 +738,7 @@ def __init__(self, name, config_name, extra_java_args=None, extra_launcher_args=
738738 self .async_sampler = False
739739 self .safepoint_sampler = False
740740 self .profile_inference_feature_extraction = False
741+ self .profile_inference_call_count = False
741742 self .force_profile_inference = False
742743 self .profile_inference_debug = False
743744 self .analysis_context_sensitivity = None
@@ -813,6 +814,8 @@ def config_name(self):
813814 config += ["adopted-jdk-pgo" ]
814815 if self .profile_inference_feature_extraction is True :
815816 config += ["profile-inference-feature-extraction" ]
817+ if self .profile_inference_call_count is True :
818+ config += ["profile-inference-call-count" ]
816819 if self .pgo_instrumentation is True and self .force_profile_inference is True :
817820 if self .pgo_exclude_conditional is True :
818821 config += ["profile-inference-pgo" ]
@@ -847,7 +850,7 @@ def _configure_from_name(self, config_name):
847850 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-)?' \
848851 r'(?P<llvm>llvm-)?(?P<pgo>pgo-|pgo-sampler-)?(?P<inliner>inline-)?' \
849852 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-)?$'
851854
852855 mx .logv (f"== Registering configuration: { config_name } " )
853856 match_name = f"{ config_name } -" # adding trailing dash to simplify the regex
@@ -970,6 +973,8 @@ def generate_profiling_package_prefixes():
970973 if profile_inference_config == 'profile-inference-feature-extraction' :
971974 self .profile_inference_feature_extraction = True
972975 self .pgo_instrumentation = True # extract code features
976+ elif profile_inference_config == 'profile-inference-call-count' :
977+ self .profile_inference_call_count = True
973978 elif profile_inference_config == "profile-inference-pgo" :
974979 # We need to run instrumentation as the profile-inference-pgo JVM config requires dynamically collected
975980 # profiles to combine with the ML-inferred branch probabilities.
@@ -1558,6 +1563,8 @@ def run_stage_image(self):
15581563 mx .warn (
15591564 "To dump the profile inference features to a specific location, please set the '{}' flag." .format (
15601565 dump_file_flag ))
1566+ elif self .profile_inference_call_count :
1567+ ml_args = svm_experimental_options (['-H:+MLCallCountProfileInference' ])
15611568 elif self .force_profile_inference :
15621569 ml_args = svm_experimental_options (['-H:+MLGraphFeaturesExtraction' , '-H:+MLProfileInference' ])
15631570 else :
0 commit comments