5#ifndef RUNTIME_VM_COMPILER_BACKEND_CONSTANT_PROPAGATOR_H_
6#define RUNTIME_VM_COMPILER_BACKEND_CONSTANT_PROPAGATOR_H_
8#if defined(DART_PRECOMPILED_RUNTIME)
9#error "AOT runtime should not use compiler sources (including header files)"
42 void InsertRedefinitionsAfterEqualityComparisons();
48 void EliminateRedundantBranches();
65 bool IsNonConstant(
const Object&
value) {
66 return value.ptr() == non_constant_.
ptr();
68 bool IsConstant(
const Object&
value) {
69 return !IsNonConstant(
value) && !IsUnknown(
value);
72 void VisitBinaryIntegerOp(BinaryIntegerOpInstr* binary_op);
73 void VisitUnaryIntegerOp(UnaryIntegerOpInstr* unary_op);
77#define DECLARE_VISIT(type, attrs) virtual void Visit##type(type##Instr* instr);
90 PhiInfo* GetPhiInfo(PhiInstr* phi);
95 const Object& unknown_;
96 const Object& non_constant_;
99 Object& constant_value_;
103 BitVector* reachable_;
109 BitVector* unwrapped_phis_;
113 GrowableArray<PhiInfo> phis_;
116 GrowableArray<BlockEntryInstr*> block_worklist_;
117 DefinitionWorklist definition_worklist_;
static void Optimize(FlowGraph *graph)
static ObjectPtr Unknown()
virtual void VisitBlocks()
ConstantPropagator(FlowGraph *graph, const GrowableArray< BlockEntryInstr * > &ignored)
static void OptimizeBranches(FlowGraph *graph)
#define DECLARE_VISIT(type, attrs)
#define FOR_EACH_INSTRUCTION(M)