v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer Class Reference

#include <loop-unrolling-reducer.h>

Collaboration diagram for v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer:

Public Member Functions

 LoopUnrollingAnalyzer (Zone *phase_zone, Graph *input_graph, bool is_wasm)
 
bool ShouldFullyUnrollLoop (const Block *loop_header) const
 
bool ShouldPartiallyUnrollLoop (const Block *loop_header) const
 
size_t GetPartialUnrollCount (const Block *loop_header) const
 
bool ShouldRemoveLoop (const Block *loop_header) const
 
IterationCount GetIterationCount (const Block *loop_header) const
 
ZoneSet< const Block *, LoopFinder::BlockCmpGetLoopBody (const Block *loop_header)
 
const BlockGetLoopHeader (const Block *block)
 
bool CanUnrollAtLeastOneLoop () const
 

Static Public Attributes

static constexpr size_t kMaxLoopSizeForFullUnrolling = 150
 
static constexpr size_t kMaxFunctionSizeForPartialUnrolling = 1'000'000
 
static constexpr size_t kJSMaxLoopSizeForPartialUnrolling = 50
 
static constexpr size_t kWasmMaxLoopSizeForPartialUnrolling = 80
 
static constexpr size_t kWasmMaxUnrolledLoopSize = 240
 
static constexpr size_t kMaxLoopIterationsForFullUnrolling = 4
 
static constexpr size_t kMaxPartialUnrollingCount = 4
 
static constexpr size_t kMaxIterForStackCheckRemoval = 5000
 

Private Member Functions

void DetectUnrollableLoops ()
 
IterationCount GetLoopIterationCount (const LoopFinder::LoopInfo &info) const
 

Private Attributes

Graphinput_graph_
 
OperationMatcher matcher_
 
LoopFinder loop_finder_
 
ZoneUnorderedMap< const Block *, IterationCountloop_iteration_count_
 
const StaticCanonicalForLoopMatcher canonical_loop_matcher_
 
const bool is_wasm_
 
const size_t kMaxLoopSizeForPartialUnrolling
 
bool can_unroll_at_least_one_loop_ = false
 
ZoneAbslFlatHashSet< uint32_t > & stack_checks_to_remove_
 

Detailed Description

Definition at line 168 of file loop-unrolling-reducer.h.

Constructor & Destructor Documentation

◆ LoopUnrollingAnalyzer()

v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::LoopUnrollingAnalyzer ( Zone * phase_zone,
Graph * input_graph,
bool is_wasm )
inline

Definition at line 182 of file loop-unrolling-reducer.h.

Member Function Documentation

◆ CanUnrollAtLeastOneLoop()

bool v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::CanUnrollAtLeastOneLoop ( ) const
inline

Definition at line 260 of file loop-unrolling-reducer.h.

Here is the caller graph for this function:

◆ DetectUnrollableLoops()

void v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::DetectUnrollableLoops ( )
private

Definition at line 27 of file loop-unrolling-reducer.cc.

Here is the call graph for this function:

◆ GetIterationCount()

IterationCount v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::GetIterationCount ( const Block * loop_header) const
inline

Definition at line 244 of file loop-unrolling-reducer.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLoopBody()

ZoneSet< const Block *, LoopFinder::BlockCmp > v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::GetLoopBody ( const Block * loop_header)
inline

Definition at line 251 of file loop-unrolling-reducer.h.

Here is the caller graph for this function:

◆ GetLoopHeader()

const Block * v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::GetLoopHeader ( const Block * block)
inline

Definition at line 256 of file loop-unrolling-reducer.h.

Here is the caller graph for this function:

◆ GetLoopIterationCount()

IterationCount v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::GetLoopIterationCount ( const LoopFinder::LoopInfo & info) const
private

Definition at line 44 of file loop-unrolling-reducer.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPartialUnrollCount()

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::GetPartialUnrollCount ( const Block * loop_header) const
inline

Definition at line 215 of file loop-unrolling-reducer.h.

Here is the caller graph for this function:

◆ ShouldFullyUnrollLoop()

bool v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::ShouldFullyUnrollLoop ( const Block * loop_header) const
inline

Definition at line 193 of file loop-unrolling-reducer.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShouldPartiallyUnrollLoop()

bool v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::ShouldPartiallyUnrollLoop ( const Block * loop_header) const
inline

Definition at line 205 of file loop-unrolling-reducer.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShouldRemoveLoop()

bool v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::ShouldRemoveLoop ( const Block * loop_header) const
inline

Definition at line 239 of file loop-unrolling-reducer.h.

Here is the caller graph for this function:

Member Data Documentation

◆ can_unroll_at_least_one_loop_

bool v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::can_unroll_at_least_one_loop_ = false
private

Definition at line 294 of file loop-unrolling-reducer.h.

◆ canonical_loop_matcher_

const StaticCanonicalForLoopMatcher v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::canonical_loop_matcher_
private

Definition at line 289 of file loop-unrolling-reducer.h.

◆ input_graph_

Graph* v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::input_graph_
private

Definition at line 282 of file loop-unrolling-reducer.h.

◆ is_wasm_

const bool v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::is_wasm_
private

Definition at line 290 of file loop-unrolling-reducer.h.

◆ kJSMaxLoopSizeForPartialUnrolling

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kJSMaxLoopSizeForPartialUnrolling = 50
staticconstexpr

Definition at line 271 of file loop-unrolling-reducer.h.

◆ kMaxFunctionSizeForPartialUnrolling

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kMaxFunctionSizeForPartialUnrolling = 1'000'000
staticconstexpr

Definition at line 270 of file loop-unrolling-reducer.h.

◆ kMaxIterForStackCheckRemoval

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kMaxIterForStackCheckRemoval = 5000
staticconstexpr

Definition at line 276 of file loop-unrolling-reducer.h.

◆ kMaxLoopIterationsForFullUnrolling

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kMaxLoopIterationsForFullUnrolling = 4
staticconstexpr

Definition at line 274 of file loop-unrolling-reducer.h.

◆ kMaxLoopSizeForFullUnrolling

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kMaxLoopSizeForFullUnrolling = 150
staticconstexpr

Definition at line 265 of file loop-unrolling-reducer.h.

◆ kMaxLoopSizeForPartialUnrolling

const size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kMaxLoopSizeForPartialUnrolling
private

◆ kMaxPartialUnrollingCount

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kMaxPartialUnrollingCount = 4
staticconstexpr

Definition at line 275 of file loop-unrolling-reducer.h.

◆ kWasmMaxLoopSizeForPartialUnrolling

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kWasmMaxLoopSizeForPartialUnrolling = 80
staticconstexpr

Definition at line 272 of file loop-unrolling-reducer.h.

◆ kWasmMaxUnrolledLoopSize

size_t v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::kWasmMaxUnrolledLoopSize = 240
staticconstexpr

Definition at line 273 of file loop-unrolling-reducer.h.

◆ loop_finder_

LoopFinder v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::loop_finder_
private

Definition at line 284 of file loop-unrolling-reducer.h.

◆ loop_iteration_count_

ZoneUnorderedMap<const Block*, IterationCount> v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::loop_iteration_count_
private

Definition at line 288 of file loop-unrolling-reducer.h.

◆ matcher_

OperationMatcher v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::matcher_
private

Definition at line 283 of file loop-unrolling-reducer.h.

◆ stack_checks_to_remove_

ZoneAbslFlatHashSet<uint32_t>& v8::internal::compiler::turboshaft::LoopUnrollingAnalyzer::stack_checks_to_remove_
private

Definition at line 296 of file loop-unrolling-reducer.h.


The documentation for this class was generated from the following files: