v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
loop-unrolling-phase.cc
Go to the documentation of this file.
1
// Copyright 2023 the V8 project authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
src/compiler/turboshaft/loop-unrolling-phase.h
"
6
7
#include "
src/base/logging.h
"
8
#include "
src/compiler/turboshaft/copying-phase.h
"
9
#include "
src/compiler/turboshaft/loop-unrolling-reducer.h
"
10
#include "
src/compiler/turboshaft/machine-optimization-reducer.h
"
11
#include "
src/compiler/turboshaft/phase.h
"
12
#include "
src/compiler/turboshaft/required-optimization-reducer.h
"
13
#include "
src/compiler/turboshaft/value-numbering-reducer.h
"
14
#include "
src/compiler/turboshaft/variable-reducer.h
"
15
#include "
src/numbers/conversions-inl.h
"
16
17
namespace
v8::internal::compiler::turboshaft
{
18
19
void
LoopUnrollingPhase::Run
(
PipelineData
* data,
Zone
* temp_zone) {
20
LoopUnrollingAnalyzer
analyzer(temp_zone, &data->graph(), data->is_wasm());
21
if
(analyzer.
CanUnrollAtLeastOneLoop
()) {
22
data->graph().set_loop_unrolling_analyzer(&analyzer);
23
turboshaft::CopyingPhase
<
LoopStackCheckElisionReducer
,
LoopUnrollingReducer
,
24
MachineOptimizationReducer
,
25
ValueNumberingReducer
>
::Run
(data, temp_zone);
26
// When the CopyingPhase finishes, it calls SwapWithCompanion, which resets
27
// the current graph's LoopUnrollingAnalyzer (since the old input_graph is
28
// now somewhat out-dated).
29
DCHECK
(!data->graph().has_loop_unrolling_analyzer());
30
// The LoopUnrollingAnalyzer should not be copied to the output_graph during
31
// CopyingPhase, since it's refering to the input_graph.
32
DCHECK
(!data->graph().GetOrCreateCompanion().has_loop_unrolling_analyzer());
33
}
34
}
35
36
}
// namespace v8::internal::compiler::turboshaft
v8::internal::Zone
Definition
zone.h:43
v8::internal::compiler::turboshaft::CopyingPhase
Definition
copying-phase.h:1065
v8::internal::compiler::turboshaft::LoopStackCheckElisionReducer
Definition
loop-unrolling-reducer.h:303
v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer
Definition
loop-unrolling-reducer.h:168
v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::CanUnrollAtLeastOneLoop
bool CanUnrollAtLeastOneLoop() const
Definition
loop-unrolling-reducer.h:260
v8::internal::compiler::turboshaft::LoopUnrollingReducer
Definition
loop-unrolling-reducer.h:372
v8::internal::compiler::turboshaft::MachineOptimizationReducer
Definition
machine-optimization-reducer.h:181
v8::internal::compiler::turboshaft::PipelineData
Definition
phase.h:177
v8::internal::compiler::turboshaft::ValueNumberingReducer
Definition
value-numbering-reducer.h:107
conversions-inl.h
copying-phase.h
loop-unrolling-phase.h
loop-unrolling-reducer.h
machine-optimization-reducer.h
v8::internal::compiler::turboshaft
Definition
builtins.h:33
required-optimization-reducer.h
logging.h
DCHECK
#define DCHECK(condition)
Definition
logging.h:482
v8::internal::compiler::turboshaft::LoopUnrollingPhase::Run
void Run(PipelineData *data, Zone *temp_zone)
Definition
loop-unrolling-phase.cc:19
phase.h
value-numbering-reducer.h
variable-reducer.h
src
compiler
turboshaft
loop-unrolling-phase.cc
Generated on Sun Apr 6 2025 21:08:52 for v8 by
1.12.0