diff options
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r-- | clang/lib/Analysis/Interval.cpp | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/clang/lib/Analysis/Interval.cpp b/clang/lib/Analysis/Interval.cpp index d005048..ac96107 100644 --- a/clang/lib/Analysis/Interval.cpp +++ b/clang/lib/Analysis/Interval.cpp @@ -702,24 +702,40 @@ void IntervalAnalysis::runOnAllBlocks() { } } + std::vector<EqnExpr*> a; + + a.push_back(&system.constant(-infinity<ZBar>())); + a.push_back(&system.constant(0)); + system[system.variable("x")] = &system.maxExpression(a); + a.clear(); + + system.variable("y"); + + a.push_back(&system.variable("x")); + a.push_back(&system.variable("z")); + EqnExpr* minExpr = &system.expression(new Maximum<ZBar>(), a); + a.clear(); + + a.push_back(&system.constant(-infinity<ZBar>())); + a.push_back(minExpr); + system[system.variable("y")] = &system.maxExpression(a); + a.clear(); + + a.push_back(&system.constant(-infinity<ZBar>())); + a.push_back(&system.variable("y")); + system[system.variable("z")] = &system.maxExpression(a); + + llvm::errs() << toString(system) << "\n"; + system.indexMaxExpressions(); + DynamicMaxStrategy<ZBar> strategy(system); + DynamicVariableAssignment<ZBar> rho(system, strategy); + strategy.setRho(rho); - IdMap<EqnVar,ZBar> result = solve_for(system); for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) { - EqnVar& var = system.variable(i); - cout << var.name() << " = " << result[var] << endl; - } - - /* - DynamicMaxStrategy<ZBar> strategy(system); - DynamicVariableAssignment<ZBar> rho(system, strategy); - strategy.setRho(rho); - - for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) { EqnVar& var = system.variable(size - i - 1); llvm::errs() << toString(var.name()) << " = " << toString(rho[var]) << "\n"; - } - */ + } } |