fix isnan sema for vectors
MODIFY
ir/fast_math.cpp
ir/fast_math.cpp
@@ -202,7 +202,7 @@ public:
expr smtOf(unsigned n) {
vector<optional<expr>> exprs; // map node id -> smt expr
- exprs.resize(uf.size());
+ exprs.resize(nodes_eqs.size());
vector<unsigned> todo = { n };
do {

MODIFY
ir/instr.cpp
ir/instr.cpp
@@ -846,8 +846,7 @@ void UnaryOp::print(ostream &os) const {
case FFS: str = "ffs "; break;
}
- os << getName() << " = " << str << fmath << print_type(getType())
- << val->getName();
+ os << getName() << " = " << str << fmath << *val;
}
StateValue UnaryOp::toSMT(State &s) const {
@@ -886,7 +885,7 @@ StateValue UnaryOp::toSMT(State &s) const {
}
case IsNaN:
fn = [](auto v, auto np) -> StateValue {
- return { v.isNaN(), expr(np) };
+ return { v.isNaN().toBVBool(), expr(np) };
};
break;
case FAbs:
@@ -943,12 +942,12 @@ StateValue UnaryOp::toSMT(State &s) const {
if (getType().isVectorType()) {
vector<StateValue> vals;
- auto ty = getType().getAsAggregateType();
+ auto ty = val->getType().getAsAggregateType();
for (unsigned i = 0, e = ty->numElementsConst(); i != e; ++i) {
auto vi = ty->extract(v, i);
vals.emplace_back(fn(vi.value, vi.non_poison));
}
- return ty->aggregateVals(vals);
+ return getType().getAsAggregateType()->aggregateVals(vals);
}
return fn(v.value, v.non_poison);
}

MODIFY
util/unionfind.h
util/unionfind.h
@@ -14,7 +14,6 @@ public:
unsigned mk();
unsigned find(unsigned i);
unsigned merge(unsigned p, unsigned q);
- auto size() const { return id.size(); }
};
}

fix isnan sema for vectors