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

#include <loop-unrolling-reducer.h>

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

Public Types

enum class  CmpOp {
  kEqual , kSignedLessThan , kSignedLessThanOrEqual , kUnsignedLessThan ,
  kUnsignedLessThanOrEqual , kSignedGreaterThan , kSignedGreaterThanOrEqual , kUnsignedGreaterThan ,
  kUnsignedGreaterThanOrEqual
}
 
enum class  BinOp {
  kAdd , kMul , kSub , kBitwiseAnd ,
  kBitwiseOr , kBitwiseXor , kOverflowCheckedAdd , kOverflowCheckedMul ,
  kOverflowCheckedSub
}
 

Public Member Functions

 StaticCanonicalForLoopMatcher (const OperationMatcher &matcher)
 
IterationCount GetIterCountIfStaticCanonicalForLoop (const Block *header, OpIndex cond_idx, bool loop_if_cond_is) const
 

Static Public Member Functions

static constexpr CmpOp ComparisonKindToCmpOp (ComparisonOp::Kind kind)
 
static constexpr CmpOp InvertComparisonOp (CmpOp op)
 
static constexpr BinOp BinopFromWordBinopKind (WordBinopOp::Kind kind)
 
static constexpr BinOp BinopFromOverflowCheckedBinopKind (OverflowCheckedBinopOp::Kind kind)
 
static constexpr bool BinopKindIsSupported (WordBinopOp::Kind binop_kind)
 

Private Member Functions

bool MatchPhiCompareCst (OpIndex cond_idx, StaticCanonicalForLoopMatcher::CmpOp *cmp_op, OpIndex *phi, uint64_t *cst) const
 
bool MatchCheckedOverflowBinop (OpIndex idx, V< Word > *left, V< Word > *right, BinOp *binop_op, WordRepresentation *binop_rep) const
 
bool MatchWordBinop (OpIndex idx, V< Word > *left, V< Word > *right, BinOp *binop_op, WordRepresentation *binop_rep) const
 
IterationCount CountIterations (uint64_t equal_cst, CmpOp cmp_op, uint64_t initial_input, uint64_t binop_cst, BinOp binop_op, WordRepresentation binop_rep, bool loop_if_cond_is) const
 
template<class Int >
IterationCount CountIterationsImpl (Int init, Int max, CmpOp cmp_op, Int binop_cst, StaticCanonicalForLoopMatcher::BinOp binop_op, WordRepresentation binop_rep, bool loop_if_cond_is) const
 

Private Attributes

const OperationMatchermatcher_
 

Static Private Attributes

static constexpr size_t kMaxExactIter = 5
 

Detailed Description

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

Member Enumeration Documentation

◆ BinOp

Enumerator
kAdd 
kMul 
kSub 
kBitwiseAnd 
kBitwiseOr 
kBitwiseXor 
kOverflowCheckedAdd 
kOverflowCheckedMul 
kOverflowCheckedSub 

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

◆ CmpOp

Enumerator
kEqual 
kSignedLessThan 
kSignedLessThanOrEqual 
kUnsignedLessThan 
kUnsignedLessThanOrEqual 
kSignedGreaterThan 
kSignedGreaterThanOrEqual 
kUnsignedGreaterThan 
kUnsignedGreaterThanOrEqual 

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

Constructor & Destructor Documentation

◆ StaticCanonicalForLoopMatcher()

v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::StaticCanonicalForLoopMatcher ( const OperationMatcher & matcher)
inlineexplicit

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

Member Function Documentation

◆ BinopFromOverflowCheckedBinopKind()

StaticCanonicalForLoopMatcher::BinOp v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::BinopFromOverflowCheckedBinopKind ( OverflowCheckedBinopOp::Kind kind)
staticconstexpr

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

Here is the caller graph for this function:

◆ BinopFromWordBinopKind()

StaticCanonicalForLoopMatcher::BinOp v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::BinopFromWordBinopKind ( WordBinopOp::Kind kind)
staticconstexpr

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

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

◆ BinopKindIsSupported()

bool v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::BinopKindIsSupported ( WordBinopOp::Kind binop_kind)
staticconstexpr

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

Here is the caller graph for this function:

◆ ComparisonKindToCmpOp()

StaticCanonicalForLoopMatcher::CmpOp v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::ComparisonKindToCmpOp ( ComparisonOp::Kind kind)
staticconstexpr

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

Here is the caller graph for this function:

◆ CountIterations()

IterationCount v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::CountIterations ( uint64_t equal_cst,
CmpOp cmp_op,
uint64_t initial_input,
uint64_t binop_cst,
BinOp binop_op,
WordRepresentation binop_rep,
bool loop_if_cond_is ) const
private

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

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

◆ CountIterationsImpl()

template<class Int >
IterationCount v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::CountIterationsImpl ( Int init,
Int max,
CmpOp cmp_op,
Int binop_cst,
StaticCanonicalForLoopMatcher::BinOp binop_op,
WordRepresentation binop_rep,
bool loop_if_cond_is ) const
private

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

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

◆ GetIterCountIfStaticCanonicalForLoop()

IterationCount v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::GetIterCountIfStaticCanonicalForLoop ( const Block * header,
OpIndex cond_idx,
bool loop_if_cond_is ) const

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

Here is the call graph for this function:

◆ InvertComparisonOp()

StaticCanonicalForLoopMatcher::CmpOp v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::InvertComparisonOp ( CmpOp op)
staticconstexpr

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

Here is the caller graph for this function:

◆ MatchCheckedOverflowBinop()

bool v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::MatchCheckedOverflowBinop ( OpIndex idx,
V< Word > * left,
V< Word > * right,
BinOp * binop_op,
WordRepresentation * binop_rep ) const
private

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

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

◆ MatchPhiCompareCst()

bool v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::MatchPhiCompareCst ( OpIndex cond_idx,
StaticCanonicalForLoopMatcher::CmpOp * cmp_op,
OpIndex * phi,
uint64_t * cst ) const
private

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

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

◆ MatchWordBinop()

bool v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::MatchWordBinop ( OpIndex idx,
V< Word > * left,
V< Word > * right,
BinOp * binop_op,
WordRepresentation * binop_rep ) const
private

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

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

Member Data Documentation

◆ kMaxExactIter

size_t v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::kMaxExactIter = 5
staticconstexprprivate

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

◆ matcher_

const OperationMatcher& v8::internal::compiler::turboshaft::StaticCanonicalForLoopMatcher::matcher_
private

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


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