From 9e1478795fb0dbb126213311b0b4483898c079e3 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Wed, 27 Sep 2017 11:25:01 -0700 Subject: Enables GVN for x86 and x86_64. Rationale: As decided after the MIPS change, this change unifies our six code generators again a bit (we cannot move it into the generic path, since arm likes to run the simplifier first). Generally the GVN does some last minute cleanup (such as finding CSE in the runtime tests generated by dynamic BCE). I started a golem run to find impact. Test: test-art-host test-art-target Change-Id: Ib4098c5bae2269e71fee95cc31e3662d3aa47f6a --- compiler/optimizing/optimizing_compiler.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 10b3fe1731..12185866cd 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -669,10 +669,10 @@ void OptimizingCompiler::RunArchOptimizations(InstructionSet instruction_set, #endif #ifdef ART_ENABLE_CODEGEN_mips case kMips: { - mips::PcRelativeFixups* pc_relative_fixups = - new (arena) mips::PcRelativeFixups(graph, codegen, stats); SideEffectsAnalysis* side_effects = new (arena) SideEffectsAnalysis(graph); GVNOptimization* gvn = new (arena) GVNOptimization(graph, *side_effects, "GVN$after_arch"); + mips::PcRelativeFixups* pc_relative_fixups = + new (arena) mips::PcRelativeFixups(graph, codegen, stats); HOptimization* mips_optimizations[] = { side_effects, gvn, @@ -696,11 +696,15 @@ void OptimizingCompiler::RunArchOptimizations(InstructionSet instruction_set, #endif #ifdef ART_ENABLE_CODEGEN_x86 case kX86: { + SideEffectsAnalysis* side_effects = new (arena) SideEffectsAnalysis(graph); + GVNOptimization* gvn = new (arena) GVNOptimization(graph, *side_effects, "GVN$after_arch"); x86::PcRelativeFixups* pc_relative_fixups = new (arena) x86::PcRelativeFixups(graph, codegen, stats); x86::X86MemoryOperandGeneration* memory_gen = new (arena) x86::X86MemoryOperandGeneration(graph, codegen, stats); HOptimization* x86_optimizations[] = { + side_effects, + gvn, pc_relative_fixups, memory_gen }; @@ -710,9 +714,13 @@ void OptimizingCompiler::RunArchOptimizations(InstructionSet instruction_set, #endif #ifdef ART_ENABLE_CODEGEN_x86_64 case kX86_64: { + SideEffectsAnalysis* side_effects = new (arena) SideEffectsAnalysis(graph); + GVNOptimization* gvn = new (arena) GVNOptimization(graph, *side_effects, "GVN$after_arch"); x86::X86MemoryOperandGeneration* memory_gen = new (arena) x86::X86MemoryOperandGeneration(graph, codegen, stats); HOptimization* x86_64_optimizations[] = { + side_effects, + gvn, memory_gen }; RunOptimizations(x86_64_optimizations, arraysize(x86_64_optimizations), pass_observer); -- cgit v1.2.3-59-g8ed1b