Skip to content

Commit

Permalink
superpmi.py: Add -jitoption for asmdiffs (#70939)
Browse files Browse the repository at this point in the history
The new `-jitoption` option passes the argument options to both baseline and diff
compilers. This is a convenience option: there already is `-base_jit_option` and
`-diff_jit_option` to specify passing options to either baseline or diff.

The name of the option is the same as that used for `replay`.
  • Loading branch information
BruceForstall committed Jun 18, 2022
1 parent 9d0fcb5 commit e771b5d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ def add_core_root_arguments(parser, build_type_default, build_type_help):
replay_parser.add_argument("-jit_path", help="Path to clrjit. Defaults to Core_Root JIT.")
replay_parser.add_argument("-jitoption", action="append", help="Pass option through to the jit. Format is key=value, where key is the option name without leading COMPlus_")

# common subparser for asmdiffs and throughput
base_diff_parser = argparse.ArgumentParser(add_help=False)
base_diff_parser.add_argument("-base_jit_path", help="Path to baseline clrjit. Defaults to baseline JIT from rolling build, by computing baseline git hash.")
base_diff_parser.add_argument("-diff_jit_path", help="Path to diff clrjit. Defaults to Core_Root JIT.")
base_diff_parser.add_argument("-git_hash", help="Use this git hash as the current hash for use to find a baseline JIT. Defaults to current git hash of source tree.")
base_diff_parser.add_argument("-base_git_hash", help="Use this git hash as the baseline JIT hash. Default: search for the baseline hash.")
base_diff_parser.add_argument("-jitoption", action="append", help="Option to pass to both baseline and diff JIT. Format is key=value, where key is the option name without leading COMPlus_")
base_diff_parser.add_argument("-base_jit_option", action="append", help="Option to pass to the baseline JIT. Format is key=value, where key is the option name without leading COMPlus_...")
base_diff_parser.add_argument("-diff_jit_option", action="append", help="Option to pass to the diff JIT. Format is key=value, where key is the option name without leading COMPlus_...")

Expand Down Expand Up @@ -1465,6 +1467,9 @@ def replay_with_asm_diffs(self):
if self.coreclr_args.base_jit_option:
for o in self.coreclr_args.base_jit_option:
base_option_flags += "-jitoption", o
if self.coreclr_args.jitoption:
for o in self.coreclr_args.jitoption:
base_option_flags += "-jitoption", o
base_option_flags_for_diff_artifact = base_option_flags

diff_option_flags = []
Expand All @@ -1473,6 +1478,10 @@ def replay_with_asm_diffs(self):
for o in self.coreclr_args.diff_jit_option:
diff_option_flags += "-jit2option", o
diff_option_flags_for_diff_artifact += "-jitoption", o
if self.coreclr_args.jitoption:
for o in self.coreclr_args.jitoption:
diff_option_flags += "-jit2option", o
diff_option_flags_for_diff_artifact += "-jitoption", o

if self.coreclr_args.altjit:
altjit_asm_diffs_flags += [
Expand Down Expand Up @@ -3376,6 +3385,11 @@ def verify_base_diff_args():
lambda unused: True,
"Unable to set base_git_hash")

coreclr_args.verify(args,
"jitoption",
lambda unused: True,
"Unable to set jitoption")

coreclr_args.verify(args,
"base_jit_option",
lambda unused: True,
Expand Down

0 comments on commit e771b5d

Please sign in to comment.