Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
dart::LoadOptimizer Class Reference
Inheritance diagram for dart::LoadOptimizer:
dart::ValueObject

Public Member Functions

 LoadOptimizer (FlowGraph *graph, AliasedSet *aliased_set)
 
 ~LoadOptimizer ()
 
Zonezone () const
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Static Public Member Functions

static bool OptimizeGraph (FlowGraph *graph)
 

Detailed Description

Definition at line 1757 of file redundancy_elimination.cc.

Constructor & Destructor Documentation

◆ LoadOptimizer()

dart::LoadOptimizer::LoadOptimizer ( FlowGraph graph,
AliasedSet aliased_set 
)
inline

Definition at line 1759 of file redundancy_elimination.cc.

1760 : graph_(graph),
1761 aliased_set_(aliased_set),
1762 in_(graph_->preorder().length()),
1763 out_(graph_->preorder().length()),
1764 gen_(graph_->preorder().length()),
1765 kill_(graph_->preorder().length()),
1766 exposed_values_(graph_->preorder().length()),
1767 out_values_(graph_->preorder().length()),
1768 phis_(5),
1769 worklist_(5),
1770 congruency_worklist_(6),
1771 in_worklist_(nullptr),
1772 forwarded_(false) {
1773 const intptr_t num_blocks = graph_->preorder().length();
1774 for (intptr_t i = 0; i < num_blocks; i++) {
1775 out_.Add(nullptr);
1776 gen_.Add(new (Z) BitVector(Z, aliased_set_->max_place_id()));
1777 kill_.Add(new (Z) BitVector(Z, aliased_set_->max_place_id()));
1778 in_.Add(new (Z) BitVector(Z, aliased_set_->max_place_id()));
1779
1780 exposed_values_.Add(nullptr);
1781 out_values_.Add(nullptr);
1782 }
1783 }
intptr_t max_place_id() const
const GrowableArray< BlockEntryInstr * > & preorder() const
Definition: flow_graph.h:203
#define Z

◆ ~LoadOptimizer()

dart::LoadOptimizer::~LoadOptimizer ( )
inline

Definition at line 1785 of file redundancy_elimination.cc.

1785{ aliased_set_->RollbackAliasedIdentities(); }

Member Function Documentation

◆ OptimizeGraph()

static bool dart::LoadOptimizer::OptimizeGraph ( FlowGraph graph)
inlinestatic

Definition at line 1789 of file redundancy_elimination.cc.

1789 {
1790 ASSERT(FLAG_load_cse);
1791
1792 // For now, bail out for large functions to avoid OOM situations.
1793 // TODO(fschneider): Fix the memory consumption issue.
1794 if (graph->is_huge_method()) {
1795 return false;
1796 }
1797
1798 PointerSet<Place> map;
1799 AliasedSet* aliased_set = NumberPlaces(graph, &map, kOptimizeLoads);
1800 if ((aliased_set != nullptr) && !aliased_set->IsEmpty()) {
1801 // If any loads were forwarded return true from Optimize to run load
1802 // forwarding again. This will allow to forward chains of loads.
1803 // This is especially important for context variables as they are built
1804 // as loads from loaded context.
1805 // TODO(vegorov): renumber newly discovered congruences during the
1806 // forwarding to forward chains without running whole pass twice.
1807 LoadOptimizer load_optimizer(graph, aliased_set);
1808 return load_optimizer.Optimize();
1809 }
1810 return false;
1811 }
LoadOptimizer(FlowGraph *graph, AliasedSet *aliased_set)
#define ASSERT(E)
static AliasedSet * NumberPlaces(FlowGraph *graph, PointerSet< Place > *map, CSEMode mode)
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
Definition: SkVx.h:680

◆ zone()

Zone * dart::LoadOptimizer::zone ( ) const
inline

Definition at line 1787 of file redundancy_elimination.cc.

1787{ return graph_->zone(); }
Zone * zone() const
Definition: flow_graph.h:261

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