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
6
7#include "src/base/logging.h"
16
18
19void 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);
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
#define DCHECK(condition)
Definition logging.h:482