This commit is contained in:
Philippe Tillet
2019-06-27 17:05:48 -07:00
parent 12e6036e5f
commit f4dedb522c
2 changed files with 8 additions and 5 deletions

View File

@@ -51,7 +51,6 @@ void tune::init_c_phi(ir::instruction *v) {
}
void tune::init_c_graph(ir::instruction *v) {
// Reference shape
ir::type::tile_shapes_t::value_type one = ir::tile_type::make_one(v->get_parent()->get_context());
ir::type::tile_shapes_t shapes;
@@ -59,8 +58,10 @@ void tune::init_c_graph(ir::instruction *v) {
shapes = store->get_pointer_operand()->get_type()->get_tile_shapes();
else if(auto *downcast = dynamic_cast<ir::downcast_inst*>(v))
return;
else
else{
// std::cout << v->get_name() << std::endl;
shapes = v->get_type()->get_tile_shapes();
}
// Reshape
if(dynamic_cast<ir::reshape_inst*>(v)){
ir::value *op = v->get_operand(0);
@@ -102,15 +103,16 @@ void tune::init_c_graph(ir::instruction *v) {
}
// Element-wise
else if(dynamic_cast<ir::user*>(v)) {
for(unsigned k = 0; k < v->get_num_results(); k++)
for(unsigned i = 0; i < shapes.size(); i ++){
for(unsigned k = 0; k < v->get_num_results(); k++){
ir::value *result = v->get_result(k);
for(unsigned i = 0; i < shapes.size(); i ++){
for(ir::value* op: v->ops()){
add_constraint({result, i}, {op, i});
}
}
}
}
}
tune::fragment_t tune::get_fragmentation_type(node_t x, graph_t &graph){
std::list<node_t> work;

View File

@@ -248,7 +248,8 @@ ir::value *conditional_expression::codegen(ir::module *mod) const{
ir::value *uncasted_true_value = true_value;
ir::value *uncasted_false_value = false_value;
implicit_cast(builder, true_value, false_value, is_float, is_ptr, is_int, is_signed);
implicit_broadcast(mod, true_value, false_value);
implicit_broadcast(mod, pred, true_value);
implicit_broadcast(mod, pred, false_value);
{
ir::value *current = true_value;
while(current != uncasted_true_value) {