fixed other small issues
authorbdemsky <bdemsky>
Wed, 26 Mar 2008 02:50:58 +0000 (02:50 +0000)
committerbdemsky <bdemsky>
Wed, 26 Mar 2008 02:50:58 +0000 (02:50 +0000)
Robust/src/Analysis/Prefetch/LoopExit.java
Robust/src/Analysis/Prefetch/PrefetchAnalysis.java

index 7876a2c3a40e8d54529d6ffe3c35408569a96d63..2b1099b6dbd10d16b067bd215c966760c1c05cd8 100644 (file)
@@ -66,8 +66,12 @@ public class LoopExit {
        if (table.containsKey(fn)) {
            if (!table.containsKey(fnnext))
                table.put(fnnext, new HashSet<FlatCondBranch>());
-           if(!table.get(fnnext).containsAll(table.get(fn))) {
-               table.get(fnnext).addAll(table.get(fn));
+           HashSet<FlatCondBranch> toadd=new HashSet<FlatCondBranch>();
+           toadd.addAll(table.get(fn));
+           if (toadd.contains(fnnext)) //can't propagate back to node
+               toadd.remove(fnnext);
+           if(!table.get(fnnext).containsAll(toadd)) {
+               table.get(fnnext).addAll(toadd);
                enqueuechange=true;
            }
        }
index 252d210b6674ff2fa5ee305f582a16e457e52529..1e62666044f0b61b2472278602148ec849b9691a 100644 (file)
@@ -694,6 +694,7 @@ public class PrefetchAnalysis {
            double newprob=trueprob*fcb.getTrueProb()+falseprob*fcb.getFalseProb();
            if (loop.isLoopingBranch(md,fcb)&&
                newprob<falseprob) {
+               System.out.println("Adjusting:"+fcb);
                newprob=falseprob;
            }