[codegen] rough template for axis_info pass

This commit is contained in:
Philippe Tillet
2019-06-24 18:57:32 -07:00
parent 72867d17d4
commit edc31cabb0
9 changed files with 222 additions and 1 deletions

View File

@@ -109,6 +109,31 @@ std::string binary_operator::repr_impl() const {
}
}
bool binary_operator::is_int_div() const {
return op_ == llop::UDiv || op_ == llop::SDiv;
}
bool binary_operator::is_int_rem() const {
return op_ == llop::URem || op_ == llop::SRem;
}
bool binary_operator::is_shl() const {
return op_ == llop::Shl;
}
bool binary_operator::is_shr() const {
return op_ == llop::LShr || op_ == llop::AShr;
}
bool binary_operator::is_int_mult() const {
return op_ == llop::Mul;
}
bool binary_operator::is_int_add_sub() const {
return op_ == llop::Add || llop::Sub;
}
binary_operator::binary_operator(op_t op, value *lhs, value *rhs, type *ty, const std::string &name, instruction *next)
: instruction(ty, 2, 1, name, next), op_(op){
set_operand(0, lhs);