Verified Commit d2f76261 authored by Tim Gymnich's avatar Tim Gymnich
Browse files

fixed some bugs and removed debug log

parent 5a6c26ff
......@@ -170,12 +170,11 @@ bool AffineRelation::leastUpperBound(AffineRelation rhs) {
}
// FIXME: i think this is transposing it twice. Maybe create a fast path for this kind of thing.
Matrix<int> combined = Matrix<int>(vectors).transpose();
dbgs(4) << combined;
Matrix<int> result = Matrix<int>::span(combined);
basis = result.reshapeColumns(basis.front().getHeight(), basis.front().getHeight());
// FIXME: figure out a better way to detect changes
return before == basis;
return before != basis;
}
// MARK: - Assignments
......@@ -187,7 +186,7 @@ void AffineRelation::affineAssignment(Value const* xi, unordered_map<Value const
Wr(index.at(variable),index.at(xi)) = factor;
}
for (Matrix<int> matrix: basis) {
for (Matrix<int>& matrix: basis) {
matrix *= Matrix<int>::span(Wr);
}
}
......
......@@ -310,7 +310,7 @@ void executeFixpointAlgorithm(Module const& M) {
dbgs(3) << " Merging with stored state\n";
bool changed = node.state.merge(merge_op, state_new);
dbgs(2) << " Outgoing state " << (changed ? "changd" : "didn't change") << ":\n"; state_new.printOutgoing(*node.basic_block, dbgs(2), 4);
dbgs(2) << " Outgoing state " << (changed ? "changed" : "didn't change") << ":\n"; state_new.printOutgoing(*node.basic_block, dbgs(2), 4);
// No changes, so no need to do anything else
if (not changed) continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment