From 2446feb60919ceb09b5cab388291a86ccdc9be10 Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Mon, 27 Jul 2020 12:25:49 +0100 Subject: Dump ISA into .cfg The optimizing compiler dumps ISA features into .cfg which can be used by the checker. A new tool perf2cfg needs to know ISA a CFG corresponds to. The tool uses this to check that input perf data has the same ISA. This CL implements in the compiler dumping ISA in addition to ISA features: begin_compilation name "isa:some_isa isa_features:feature1,-feature2" method "isa:some_isa isa_features:feature1,-feature2" date 1580721972 end_compilation Bug: 147876827 Test: ./art/tools/checker/run_unit_tests.py Test: test.py --target --optimizing --jit --interpreter Test: test.py --host --optimizing --jit --interpreter Change-Id: I189eae0f4de61e6a49c01d925e7136b5f7027c91 --- compiler/optimizing/optimizing_compiler.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index de86c44246..f201f806d6 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -440,11 +440,14 @@ OptimizingCompiler::~OptimizingCompiler() { void OptimizingCompiler::DumpInstructionSetFeaturesToCfg() const { const CompilerOptions& compiler_options = GetCompilerOptions(); const InstructionSetFeatures* features = compiler_options.GetInstructionSetFeatures(); + std::string isa_string = + std::string("isa:") + GetInstructionSetString(features->GetInstructionSet()); std::string features_string = "isa_features:" + features->GetFeatureString(); // It is assumed that visualizer_output_ is empty when calling this function, hence the fake // compilation block containing the ISA features will be printed at the beginning of the .cfg // file. - *visualizer_output_ << HGraphVisualizer::InsertMetaDataAsCompilationBlock(features_string); + *visualizer_output_ + << HGraphVisualizer::InsertMetaDataAsCompilationBlock(isa_string + ' ' + features_string); } bool OptimizingCompiler::CanCompileMethod(uint32_t method_idx ATTRIBUTE_UNUSED, -- cgit v1.2.3-59-g8ed1b