#include <loops.h>
Definition at line 210 of file loops.h.
◆ LoopInfo()
Definition at line 980 of file loops.cc.
981 : id_(id),
984 back_edges_(),
985 induction_(),
986 memo_cache_(),
987 limit_(nullptr),
988 control_(nullptr),
989 outer_(nullptr),
990 inner_(nullptr),
991 next_(nullptr) {}
BitVector * blocks() const
BlockEntryInstr * header() const
◆ AddBackEdge()
Definition at line 997 of file loops.cc.
997 {
998 back_edges_.Add(block);
999}
◆ AddBlocks()
void dart::LoopInfo::AddBlocks |
( |
BitVector * |
blocks | ) |
|
Definition at line 993 of file loops.cc.
993 {
995}
bool AddAll(const BitVector *from)
◆ AddInduction()
Definition at line 1075 of file loops.cc.
1075 {
1077 ASSERT(induc !=
nullptr);
1078 induction_.Insert(InductionKV::Pair(def, induc));
1079}
◆ back_edges()
Definition at line 254 of file loops.h.
254{ return back_edges_; }
◆ blocks()
◆ Contains()
Definition at line 1058 of file loops.cc.
1058 {
1059 return blocks_->
Contains(block->preorder_number());
1060}
bool Contains(intptr_t i) const
◆ control()
◆ header()
◆ id()
intptr_t dart::LoopInfo::id |
( |
| ) |
const |
|
inline |
◆ inner()
LoopInfo * dart::LoopInfo::inner |
( |
| ) |
const |
|
inline |
◆ IsAlwaysTaken()
Definition at line 1010 of file loops.cc.
1010 {
1011
1012
1013
1014 if (block == header_) {
1015 return true;
1016 } else if (block->PredecessorCount() != 1 ||
1017 block->PredecessorAt(0) != header_) {
1018 return false;
1019 }
1020
1021
1022 if (control_ != nullptr) {
1024 for (
auto bound : control_->
bounds()) {
1026 limit = bound.limit_;
1027 break;
1028 }
1029 }
1030
1031 if (
limit !=
nullptr) {
1032 int64_t stride = 0;
1039 return true;
1040 }
1041 }
1042 }
1043 return false;
1044}
Instruction * last_instruction() const
static bool IsConstant(const InductionVar *x)
InductionVar * initial() const
static bool IsLinear(const InductionVar *x)
ConstraintInstr * limit() const
friend class InductionVar
static const char * begin(const StringSlice &s)
Optional< SkRect > bounds
◆ IsBackEdge()
Definition at line 1001 of file loops.cc.
1001 {
1002 for (intptr_t i = 0, n = back_edges_.length(); i < n; i++) {
1003 if (back_edges_[i] == block) {
1004 return true;
1005 }
1006 }
1007 return false;
1008}
◆ IsHeaderPhi()
bool dart::LoopInfo::IsHeaderPhi |
( |
Definition * |
def | ) |
const |
Definition at line 1046 of file loops.cc.
1046 {
1047 return def != nullptr && def->IsPhi() && def->GetBlock() == header_ &&
1048 !def->AsPhi()->IsRedundant();
1049}
◆ IsIn()
bool dart::LoopInfo::IsIn |
( |
LoopInfo * |
loop | ) |
const |
Definition at line 1051 of file loops.cc.
1051 {
1052 if (loop != nullptr) {
1053 return loop->Contains(header_);
1054 }
1055 return false;
1056}
◆ IsInRange()
Definition at line 1093 of file loops.cc.
1093 {
1095 index->definition()->OriginalDefinitionIgnoreBoxingAndConstraints());
1097 length->definition()->OriginalDefinitionIgnoreBoxingAndConstraints());
1098 if (induc != nullptr && len != nullptr) {
1099
1100
1101 int64_t stride = 0;
1102 int64_t val = 0;
1103 int64_t diff = 0;
1106 for (
auto bound : induc->
bounds()) {
1107 if (
pos->IsDominatedBy(bound.branch_) &&
1108 len->CanComputeDifferenceWith(bound.limit_, &diff) && diff <= 0) {
1109 return true;
1110 }
1111 }
1112 }
1113
1114
1115
1118 if (induc->CanComputeBounds(
this,
pos, &
min, &
max)) {
1120 len->CanComputeDifferenceWith(
max, &diff) && diff < 0;
1121 }
1122 }
1123 return false;
1124}
InductionVar * LookupInduction(Definition *def) const
static float max(float r, float g, float b)
static float min(float r, float g, float b)
◆ limit()
◆ LookupInduction()
Definition at line 1081 of file loops.cc.
1081 {
1082 InductionKV::Pair* pair = induction_.Lookup(def);
1083 if (pair != nullptr) {
1084 return pair->value;
1085 }
1086 return nullptr;
1087}
◆ NestingDepth()
intptr_t dart::LoopInfo::NestingDepth |
( |
| ) |
const |
Definition at line 1062 of file loops.cc.
1062 {
1063 intptr_t nesting_depth = 1;
1064 for (LoopInfo* o = outer_; o != nullptr; o = o->outer()) {
1065 nesting_depth++;
1066 }
1067 return nesting_depth;
1068}
◆ next()
LoopInfo * dart::LoopInfo::next |
( |
| ) |
const |
|
inline |
◆ outer()
LoopInfo * dart::LoopInfo::outer |
( |
| ) |
const |
|
inline |
◆ PrintTo()
Definition at line 1126 of file loops.cc.
1126 {
1127 f->Printf(
"%*c",
static_cast<int>(2 *
NestingDepth()),
' ');
1128 f->Printf(
"loop%" Pd " B%" Pd " ", id_, header_->
block_id());
1129 intptr_t num_blocks = 0;
1130 for (BitVector::Iterator it(blocks_); !it.Done(); it.Advance()) {
1131 num_blocks++;
1132 }
1133 f->Printf(
"#blocks=%" Pd, num_blocks);
1134 if (outer_ !=
nullptr)
f->Printf(
" outer=%" Pd, outer_->id_);
1135 if (inner_ !=
nullptr)
f->Printf(
" inner=%" Pd, inner_->id_);
1136 if (next_ !=
nullptr)
f->Printf(
" next=%" Pd, next_->id_);
1138 for (intptr_t i = 0, n = back_edges_.length(); i < n; i++) {
1139 f->Printf(
" B%" Pd, back_edges_[i]->block_id());
1140 }
1142}
intptr_t block_id() const
intptr_t NestingDepth() const
◆ ResetInduction()
void dart::LoopInfo::ResetInduction |
( |
| ) |
|
Definition at line 1070 of file loops.cc.
1070 {
1071 induction_.Clear();
1072 memo_cache_.Clear();
1073}
◆ ToCString()
const char * dart::LoopInfo::ToCString |
( |
| ) |
const |
Definition at line 1144 of file loops.cc.
1144 {
1149}
void PrintTo(BaseTextBuffer *f) const
static Thread * Current()
char * MakeCopyOfString(const char *str)
static const uint8_t buffer[]
◆ InductionVar
◆ InductionVarAnalysis
◆ LoopHierarchy
The documentation for this class was generated from the following files:
- third_party/dart-lang/sdk/runtime/vm/compiler/backend/loops.h
- third_party/dart-lang/sdk/runtime/vm/compiler/backend/loops.cc