Commit 086bc498 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Remove support for --turbo-types.

We had exactly one test case for --noturbo-types, so it's likely that
the generic pipeline (without types) was already broken for quite some
time, plus no one expressed interest in maintaining it, plus it
complicates the JSGenericLowering integration. So decision is to kill
it.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1872333002

Cr-Commit-Position: refs/heads/master@{#35387}
parent 79ff6507
......@@ -136,7 +136,6 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info,
if (FLAG_turbo_inlining) MarkAsInliningEnabled();
if (FLAG_turbo_source_positions) MarkAsSourcePositionsEnabled();
if (FLAG_turbo_splitting) MarkAsSplittingEnabled();
if (FLAG_turbo_types) MarkAsTypingEnabled();
if (has_shared_info()) {
if (shared_info()->never_compiled()) MarkAsFirstCompile();
......
......@@ -154,13 +154,12 @@ class CompilationInfo {
kFrameSpecializing = 1 << 9,
kNativeContextSpecializing = 1 << 10,
kInliningEnabled = 1 << 11,
kTypingEnabled = 1 << 12,
kDisableFutureOptimization = 1 << 13,
kSplittingEnabled = 1 << 14,
kDeoptimizationEnabled = 1 << 16,
kSourcePositionsEnabled = 1 << 17,
kFirstCompile = 1 << 18,
kBailoutOnUninitialized = 1 << 19,
kDisableFutureOptimization = 1 << 12,
kSplittingEnabled = 1 << 13,
kDeoptimizationEnabled = 1 << 14,
kSourcePositionsEnabled = 1 << 15,
kFirstCompile = 1 << 16,
kBailoutOnUninitialized = 1 << 17,
};
CompilationInfo(ParseInfo* parse_info, Handle<JSFunction> closure);
......@@ -289,10 +288,6 @@ class CompilationInfo {
bool is_inlining_enabled() const { return GetFlag(kInliningEnabled); }
void MarkAsTypingEnabled() { SetFlag(kTypingEnabled); }
bool is_typing_enabled() const { return GetFlag(kTypingEnabled); }
void MarkAsSplittingEnabled() { SetFlag(kSplittingEnabled); }
bool is_splitting_enabled() const { return GetFlag(kSplittingEnabled); }
......
......@@ -28,10 +28,7 @@ static CallDescriptor::Flags AdjustFrameStatesForCall(Node* node) {
: CallDescriptor::kNoFlags;
}
JSGenericLowering::JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph)
: is_typing_enabled_(is_typing_enabled), jsgraph_(jsgraph) {}
JSGenericLowering::JSGenericLowering(JSGraph* jsgraph) : jsgraph_(jsgraph) {}
JSGenericLowering::~JSGenericLowering() {}
......@@ -44,19 +41,6 @@ Reduction JSGenericLowering::Reduce(Node* node) {
break;
JS_OP_LIST(DECLARE_CASE)
#undef DECLARE_CASE
case IrOpcode::kBranch:
case IrOpcode::kDeoptimizeIf:
case IrOpcode::kDeoptimizeUnless:
// TODO(mstarzinger): If typing is enabled then simplified lowering will
// have inserted the correct ChangeBoolToBit, otherwise we need to perform
// poor-man's representation inference here and insert manual change.
if (!is_typing_enabled_) {
Node* condition = node->InputAt(0);
Node* test = graph()->NewNode(machine()->WordEqual(), condition,
jsgraph()->TrueConstant());
node->ReplaceInput(0, test);
}
// Fall-through.
default:
// Nothing to see.
return NoChange();
......
......@@ -24,7 +24,7 @@ class Linkage;
// Lowers JS-level operators to runtime and IC calls in the "generic" case.
class JSGenericLowering final : public Reducer {
public:
JSGenericLowering(bool is_typing_enabled, JSGraph* jsgraph);
explicit JSGenericLowering(JSGraph* jsgraph);
~JSGenericLowering() final;
Reduction Reduce(Node* node) final;
......@@ -47,7 +47,6 @@ class JSGenericLowering final : public Reducer {
MachineOperatorBuilder* machine() const;
private:
bool const is_typing_enabled_;
JSGraph* const jsgraph_;
};
......
......@@ -498,7 +498,6 @@ PipelineCompilationJob::Status PipelineCompilationJob::CreateGraphImpl() {
}
if (FLAG_native_context_specialization) {
info()->MarkAsNativeContextSpecializing();
info()->MarkAsTypingEnabled();
}
}
if (!info()->shared_info()->asm_function() || FLAG_turbo_asm_deoptimization) {
......@@ -873,8 +872,7 @@ struct GenericLoweringPhase {
data->common());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->common(), data->machine());
JSGenericLowering generic_lowering(data->info()->is_typing_enabled(),
data->jsgraph());
JSGenericLowering generic_lowering(data->jsgraph());
SelectLowering select_lowering(data->jsgraph()->graph(),
data->jsgraph()->common());
TailCallOptimization tco(data->common(), data->graph());
......@@ -1124,9 +1122,8 @@ struct VerifyGraphPhase {
static const char* phase_name() { return nullptr; }
void Run(PipelineData* data, Zone* temp_zone, const bool untyped) {
Verifier::Run(data->graph(), FLAG_turbo_types && !untyped
? Verifier::TYPED
: Verifier::UNTYPED);
Verifier::Run(data->graph(),
!untyped ? Verifier::TYPED : Verifier::UNTYPED);
}
};
......@@ -1201,9 +1198,7 @@ Handle<Code> Pipeline::GenerateCode() {
Run<LoopAssignmentAnalysisPhase>();
}
if (info()->is_typing_enabled()) {
Run<TypeHintAnalysisPhase>();
}
Run<TypeHintAnalysisPhase>();
Run<GraphBuilderPhase>();
if (data.compilation_failed()) return Handle<Code>::null();
......@@ -1228,54 +1223,50 @@ Handle<Code> Pipeline::GenerateCode() {
GraphReplayPrinter::PrintReplay(data.graph());
}
// Type the graph.
base::SmartPointer<Typer> typer;
if (info()->is_typing_enabled()) {
// Type the graph.
typer.Reset(new Typer(isolate(), data.graph(),
info()->is_deoptimization_enabled()
? Typer::kDeoptimizationEnabled
: Typer::kNoFlags,
info()->dependencies()));
Run<TyperPhase>(typer.get());
RunPrintAndVerify("Typed");
}
typer.Reset(new Typer(isolate(), data.graph(),
info()->is_deoptimization_enabled()
? Typer::kDeoptimizationEnabled
: Typer::kNoFlags,
info()->dependencies()));
Run<TyperPhase>(typer.get());
RunPrintAndVerify("Typed");
BeginPhaseKind("lowering");
if (info()->is_typing_enabled()) {
// Lower JSOperators where we can determine types.
Run<TypedLoweringPhase>();
RunPrintAndVerify("Lowered typed");
// Lower JSOperators where we can determine types.
Run<TypedLoweringPhase>();
RunPrintAndVerify("Lowered typed");
if (FLAG_turbo_stress_loop_peeling) {
Run<StressLoopPeelingPhase>();
RunPrintAndVerify("Loop peeled");
}
if (FLAG_turbo_escape) {
Run<EscapeAnalysisPhase>();
RunPrintAndVerify("Escape Analysed");
}
if (FLAG_turbo_stress_loop_peeling) {
Run<StressLoopPeelingPhase>();
RunPrintAndVerify("Loop peeled");
}
// Lower simplified operators and insert changes.
Run<SimplifiedLoweringPhase>();
RunPrintAndVerify("Lowered simplified");
if (FLAG_turbo_escape) {
Run<EscapeAnalysisPhase>();
RunPrintAndVerify("Escape Analysed");
}
Run<BranchEliminationPhase>();
RunPrintAndVerify("Branch conditions eliminated");
// Lower simplified operators and insert changes.
Run<SimplifiedLoweringPhase>();
RunPrintAndVerify("Lowered simplified");
// Optimize control flow.
if (FLAG_turbo_cf_optimization) {
Run<ControlFlowOptimizationPhase>();
RunPrintAndVerify("Control flow optimized");
}
Run<BranchEliminationPhase>();
RunPrintAndVerify("Branch conditions eliminated");
// Lower changes that have been inserted before.
Run<ChangeLoweringPhase>();
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
RunPrintAndVerify("Lowered changes", true);
// Optimize control flow.
if (FLAG_turbo_cf_optimization) {
Run<ControlFlowOptimizationPhase>();
RunPrintAndVerify("Control flow optimized");
}
// Lower changes that have been inserted before.
Run<ChangeLoweringPhase>();
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
RunPrintAndVerify("Lowered changes", true);
// Lower any remaining generic JSOperators.
Run<GenericLoweringPhase>();
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
......
......@@ -2530,7 +2530,7 @@ Handle<JSFunction> CompileJSToWasmWrapper(
typer.Run(roots);
// Run generic and change lowering.
JSGenericLowering generic(true, &jsgraph);
JSGenericLowering generic(&jsgraph);
ChangeLowering changes(&jsgraph);
GraphReducer graph_reducer(&zone, &graph, jsgraph.Dead());
graph_reducer.AddReducer(&changes);
......@@ -2620,7 +2620,7 @@ Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module,
typer.Run(roots);
// Run generic and change lowering.
JSGenericLowering generic(true, &jsgraph);
JSGenericLowering generic(&jsgraph);
ChangeLowering changes(&jsgraph);
GraphReducer graph_reducer(&zone, &graph, jsgraph.Dead());
graph_reducer.AddReducer(&changes);
......
......@@ -426,7 +426,6 @@ DEFINE_BOOL(turbo_asm_deoptimization, false,
DEFINE_BOOL(turbo_verify, DEBUG_BOOL, "verify TurboFan graphs at each phase")
DEFINE_BOOL(turbo_stats, false, "print TurboFan statistics")
DEFINE_BOOL(turbo_splitting, true, "split nodes during scheduling in TurboFan")
DEFINE_BOOL(turbo_types, true, "use typed lowering in TurboFan")
DEFINE_BOOL(turbo_source_positions, false,
"track source code positions when building TurboFan IR")
DEFINE_IMPLICATION(trace_turbo, turbo_source_positions)
......
......@@ -68,7 +68,6 @@
'compiler/test-node.cc',
'compiler/test-operator.cc',
'compiler/test-osr.cc',
'compiler/test-pipeline.cc',
'compiler/test-representation-change.cc',
'compiler/test-run-bytecode-graph-builder.cc',
'compiler/test-run-calls-to-external-references.cc',
......
......@@ -31,7 +31,7 @@ class FunctionTester : public InitializedHandleScope {
Compile(function);
const uint32_t supported_flags =
CompilationInfo::kFunctionContextSpecializing |
CompilationInfo::kInliningEnabled | CompilationInfo::kTypingEnabled;
CompilationInfo::kInliningEnabled;
CHECK_EQ(0u, flags_ & ~supported_flags);
}
......@@ -188,9 +188,6 @@ class FunctionTester : public InitializedHandleScope {
if (flags_ & CompilationInfo::kInliningEnabled) {
info.MarkAsInliningEnabled();
}
if (flags_ & CompilationInfo::kTypingEnabled) {
info.MarkAsTypingEnabled();
}
CHECK(Compiler::Analyze(info.parse_info()));
CHECK(Compiler::EnsureDeoptimizationSupport(&info));
......
// Copyright 2013 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler.h"
#include "src/compiler/pipeline.h"
#include "src/handles.h"
#include "src/parsing/parser.h"
#include "test/cctest/cctest.h"
namespace v8 {
namespace internal {
namespace compiler {
static void RunPipeline(Zone* zone, const char* source) {
Handle<JSFunction> function = Handle<JSFunction>::cast(v8::Utils::OpenHandle(
*v8::Local<v8::Function>::Cast(CompileRun(source))));
ParseInfo parse_info(zone, function);
CHECK(Compiler::ParseAndAnalyze(&parse_info));
CompilationInfo info(&parse_info, function);
info.SetOptimizing();
Pipeline pipeline(&info);
Handle<Code> code = pipeline.GenerateCode();
CHECK(!code.is_null());
}
TEST(PipelineTyped) {
HandleAndZoneScope handles;
FLAG_turbo_types = true;
RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })");
}
TEST(PipelineGeneric) {
HandleAndZoneScope handles;
FLAG_turbo_types = false;
RunPipeline(handles.main_zone(), "(function(a,b) { return a + b; })");
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -47,14 +47,11 @@ void InstallAssertInlineCountHelper(v8::Isolate* isolate) {
.FromJust());
}
const uint32_t kRestrictedInliningFlags =
CompilationInfo::kFunctionContextSpecializing |
CompilationInfo::kTypingEnabled;
CompilationInfo::kFunctionContextSpecializing;
const uint32_t kInlineFlags = CompilationInfo::kInliningEnabled |
CompilationInfo::kFunctionContextSpecializing |
CompilationInfo::kTypingEnabled;
CompilationInfo::kFunctionContextSpecializing;
} // namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment