FlatOpNode fcomp=new FlatOpNode(tmpbool,index,temparray[i],new Operation(Operation.LT));
FlatCondBranch fcb=new FlatCondBranch(tmpbool);
+ fcb.setTrueProb(0.8);
//is index<temp[i]
TempDescriptor new_tmp=TempDescriptor.tempFactory("tmp",td);
FlatNew fn=new FlatNew(td, new_tmp, temparray[i+1], isglobal);
NodePair body=flattenBlockNode(ln.getBody());
FlatNode begin=initializer.getBegin();
FlatCondBranch fcb=new FlatCondBranch(cond_temp);
+ fcb.setTrueProb(0.8);
FlatNop nopend=new FlatNop();
FlatBackEdge backedge=new FlatBackEdge();
NodePair body=flattenBlockNode(ln.getBody());
FlatNode begin=condition.getBegin();
FlatCondBranch fcb=new FlatCondBranch(cond_temp);
+ fcb.setTrueProb(0.8);
FlatNop nopend=new FlatNop();
FlatBackEdge backedge=new FlatBackEdge();
NodePair body=flattenBlockNode(ln.getBody());
FlatNode begin=body.getBegin();
FlatCondBranch fcb=new FlatCondBranch(cond_temp);
+ fcb.setTrueProb(0.8);
FlatNop nopend=new FlatNop();
FlatBackEdge backedge=new FlatBackEdge();
public class FlatCondBranch extends FlatNode {
TempDescriptor test_cond;
+ double trueprob=0.5;
public FlatCondBranch(TempDescriptor td) {
test_cond=td;
}
+ public void setTrueProb(double p) {
+ trueprob=p;
+ }
+
+ public double getTrueProb() {
+ return trueprob;
+ }
+
+ public double getFalseProb() {
+ return 1-trueprob;
+ }
+
public void addTrueNext(FlatNode n) {
if (next.size()==0)
next.setSize(1);