summaryrefslogtreecommitdiff
path: root/src/omegatools.cc
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-10-11 19:51:20 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-10-11 19:51:20 -0600
commitcbe925bd7264c4e14681db16a14805670fd07c71 (patch)
tree7af56dae67337af763a1fa2c34daab9c7c85291d /src/omegatools.cc
parent740a983e76347a757e2c91bfaaddb6538f376006 (diff)
downloadchill-cbe925bd7264c4e14681db16a14805670fd07c71.tar.gz
chill-cbe925bd7264c4e14681db16a14805670fd07c71.tar.bz2
chill-cbe925bd7264c4e14681db16a14805670fd07c71.zip
for loop index replacement
Diffstat (limited to 'src/omegatools.cc')
-rw-r--r--src/omegatools.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/omegatools.cc b/src/omegatools.cc
index 6d48a3c..c9f3a9a 100644
--- a/src/omegatools.cc
+++ b/src/omegatools.cc
@@ -241,12 +241,16 @@ void exp2formula(IR_Code *ir,
std::vector<CG_outputRepr *> v = ir->QueryExpOperand(repr);
CHILL_DEBUG_PRINT("IR_OP_MINUS v has %d parts\n", (int) v.size());
- exp2formula(ir, r, f_and, freevars, v[0], e1, side, IR_COND_EQ, true,
- uninterpreted_symbols, uninterpreted_symbols_stringrepr);
-
if (v.size() > 1) {
+ exp2formula(ir, r, f_and, freevars, v[0], e1, side, IR_COND_EQ, true,
+ uninterpreted_symbols, uninterpreted_symbols_stringrepr);
exp2formula(ir, r, f_and, freevars, v[1], e2, side, IR_COND_EQ, true,
uninterpreted_symbols, uninterpreted_symbols_stringrepr);
+ } else {
+ exp2formula(ir, r, f_and, freevars, new CG_chillRepr(new chillAST_IntegerLiteral(0)), e1, side, IR_COND_EQ, true,
+ uninterpreted_symbols, uninterpreted_symbols_stringrepr);
+ exp2formula(ir, r, f_and, freevars, v[0], e2, side, IR_COND_EQ, true,
+ uninterpreted_symbols, uninterpreted_symbols_stringrepr);
}