summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/Andersens.cpp
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2007-09-16 23:59:53 +0000
committerDaniel Berlin <dberlin@dberlin.org>2007-09-16 23:59:53 +0000
commit90aaa1dcf7bac94faf1125a0345b41d7d68d0a4f (patch)
treef69afd4ef48a32a013861d8b788f42870d45fdcf /llvm/lib/Analysis/IPA/Andersens.cpp
parentc637abee96654c63b3e3578fcae9a758ef0b5145 (diff)
downloadbcm5719-llvm-90aaa1dcf7bac94faf1125a0345b41d7d68d0a4f.tar.gz
bcm5719-llvm-90aaa1dcf7bac94faf1125a0345b41d7d68d0a4f.zip
Fix bug in andersen's related to test_and_set.
Add operator == and != to SparseBitVector. Simplify code for test_and_set llvm-svn: 42018
Diffstat (limited to 'llvm/lib/Analysis/IPA/Andersens.cpp')
-rw-r--r--llvm/lib/Analysis/IPA/Andersens.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp
index fed246091d7..9a1ff569b88 100644
--- a/llvm/lib/Analysis/IPA/Andersens.cpp
+++ b/llvm/lib/Analysis/IPA/Andersens.cpp
@@ -1212,10 +1212,9 @@ void Andersens::SolveConstraints() {
}
do {
- Changed = false;
-
+ Changed = false;
++NumIters;
- DOUT << "Starting iteration #" << Iteration++ << "!\n";
+ DOUT << "Starting iteration #" << Iteration++;
// TODO: In the microoptimization category, we could just make Topo2Node
// a fast map and thus only contain the visited nodes.
for (unsigned i = 0; i < GraphNodes.size(); ++i) {
@@ -1295,7 +1294,7 @@ void Andersens::SolveConstraints() {
// Add an edge to the graph, so we can just do regular bitmap ior next
// time. It may also let us notice a cycle.
- if (!GraphNodes[*Src].Edges->test_and_set(*Dest)) {
+ if (GraphNodes[*Src].Edges->test_and_set(*Dest)) {
if (GraphNodes[*Dest].PointsTo |= *(GraphNodes[*Src].PointsTo)) {
GraphNodes[*Dest].Changed = true;
// If we changed a node we've already processed, we need another
OpenPOWER on IntegriCloud