summary refs log tree commit diff
path: root/rega.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-05 15:15:10 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-05 15:15:19 -0400
commit865964706f9c3f4f564849589b8cc1bada970569 (patch)
tree04868c9923fede969db03e1da62ddb09660eb4ec /rega.c
parentf6bd53d2adfcd6e0abcbb2070759ca0241d5d7b7 (diff)
downloadroux-865964706f9c3f4f564849589b8cc1bada970569.tar.gz
use bsiter() for better performance
Diffstat (limited to 'rega.c')
-rw-r--r--rega.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/rega.c b/rega.c
index 927e5aa..3b3c215 100644
--- a/rega.c
+++ b/rega.c
@@ -556,12 +556,11 @@ rega(Fn *fn)
 					src = rref(&end[b->id], src.val);
 				pmadd(src, dst, p->cls);
 			}
-			for (t=Tmp0; t<fn->ntmp; t++)
-				if (bshas(s->in, t)) {
-					src = rref(&end[b->id], t);
-					dst = rref(&beg[s->id], t);
-					pmadd(src, dst, tmp[t].cls);
-				}
+			for (t=Tmp0; bsiter(s->in, &t); t++) {
+				src = rref(&end[b->id], t);
+				dst = rref(&beg[s->id], t);
+				pmadd(src, dst, tmp[t].cls);
+			}
 			pmgen();
 			if (curi == insb)
 				continue;