Lines Matching refs:ir
64 virtual ir_visitor_status visit(ir_dereference_variable *ir);
66 virtual ir_visitor_status visit_enter(ir_discard *ir);
67 virtual ir_visitor_status visit_enter(ir_if *ir);
69 virtual ir_visitor_status visit_enter(ir_function *ir);
70 virtual ir_visitor_status visit_leave(ir_function *ir);
71 virtual ir_visitor_status visit_enter(ir_function_signature *ir);
72 virtual ir_visitor_status visit_enter(ir_return *ir);
74 virtual ir_visitor_status visit_leave(ir_expression *ir);
75 virtual ir_visitor_status visit_leave(ir_swizzle *ir);
80 virtual ir_visitor_status visit_enter(ir_assignment *ir);
81 virtual ir_visitor_status visit_enter(ir_call *ir);
83 static void validate_ir(ir_instruction *ir, void *data);
93 ir_validate::visit(ir_dereference_variable *ir) in visit() argument
95 if ((ir->var == NULL) || (ir->var->as_variable() == NULL)) { in visit()
97 (void *) ir, (void *) ir->var); in visit()
104 if (ir->var->type->without_array() != ir->type->without_array()) { in visit()
106 ir->print(); in visit()
111 if (_mesa_set_search(ir_set, ir->var) == NULL) { in visit()
114 (void *) ir, ir->var->name, (void *) ir->var); in visit()
118 this->validate_ir(ir, this->data_enter); in visit()
124 ir_validate::visit_enter(class ir_dereference_array *ir) in visit_enter() argument
126 if (!ir->array->type->is_array() && !ir->array->type->is_matrix() && in visit_enter()
127 !ir->array->type->is_vector()) { in visit_enter()
130 (void *) ir); in visit_enter()
131 ir->print(); in visit_enter()
136 if (ir->array->type->is_array()) { in visit_enter()
137 if (ir->array->type->fields.array != ir->type) { in visit_enter()
140 ir->print(); in visit_enter()
144 } else if (ir->array->type->base_type != ir->type->base_type) { in visit_enter()
146 ir->print(); in visit_enter()
151 if (!ir->array_index->type->is_scalar()) { in visit_enter()
153 (void *) ir, ir->array_index->type->name); in visit_enter()
157 if (!ir->array_index->type->is_integer_16_32()) { in visit_enter()
159 (void *) ir, ir->array_index->type->name); in visit_enter()
167 ir_validate::visit_enter(class ir_dereference_record *ir) in visit_enter() argument
169 if (!ir->record->type->is_struct() && !ir->record->type->is_interface()) { in visit_enter()
171 (void *) ir); in visit_enter()
172 ir->print(); in visit_enter()
177 if (ir->record->type->fields.structure[ir->field_idx].type != ir->type) { in visit_enter()
180 ir->print(); in visit_enter()
189 ir_validate::visit_enter(ir_discard *ir) in visit_enter() argument
191 if (ir->condition && ir->condition->type != glsl_type::bool_type) { in visit_enter()
193 ir->condition->type->name); in visit_enter()
194 ir->print(); in visit_enter()
203 ir_validate::visit_enter(ir_if *ir) in visit_enter() argument
205 if (ir->condition->type != glsl_type::bool_type) { in visit_enter()
207 ir->condition->type->name); in visit_enter()
208 ir->print(); in visit_enter()
218 ir_validate::visit_enter(ir_function *ir) in visit_enter() argument
226 ir->name, (void *) ir, in visit_enter()
235 this->current_function = ir; in visit_enter()
237 this->validate_ir(ir, this->data_enter); in visit_enter()
242 foreach_in_list(ir_instruction, sig, &ir->signatures) { in visit_enter()
245 ir->name); in visit_enter()
254 ir_validate::visit_leave(ir_function *ir) in visit_leave() argument
256 assert(ralloc_parent(ir->name) == ir); in visit_leave()
263 ir_validate::visit_enter(ir_function_signature *ir) in visit_enter() argument
265 if (this->current_function != ir->function()) { in visit_enter()
269 (void *) ir, in visit_enter()
271 ir->function_name(), (void *) ir->function()); in visit_enter()
275 if (ir->return_type == NULL) { in visit_enter()
277 (void *) ir, ir->function_name()); in visit_enter()
281 this->validate_ir(ir, this->data_enter); in visit_enter()
287 ir_validate::visit_enter(ir_return *ir) in visit_enter() argument
298 ir_validate::visit_leave(ir_expression *ir) in visit_leave() argument
300 for (unsigned i = ir->num_operands; i < 4; i++) { in visit_leave()
301 assert(ir->operands[i] == NULL); in visit_leave()
304 for (unsigned i = 0; i < ir->num_operands; i++) { in visit_leave()
305 assert(ir->operands[i] != NULL); in visit_leave()
308 switch (ir->operation) { in visit_leave()
310 assert(ir->operands[0]->type == ir->type); in visit_leave()
313 assert(ir->type->is_boolean()); in visit_leave()
314 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
318 assert(ir->type == ir->operands[0]->type); in visit_leave()
323 assert(ir->operands[0]->type->is_int_16_32_64() || in visit_leave()
324 ir->operands[0]->type->is_float_16_32_64()); in visit_leave()
325 assert(ir->type == ir->operands[0]->type); in visit_leave()
331 assert(ir->type->is_float_16_32_64()); in visit_leave()
332 assert(ir->type == ir->operands[0]->type); in visit_leave()
340 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
341 assert(ir->type == ir->operands[0]->type); in visit_leave()
345 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
346 assert(ir->type->is_int_16_32()); in visit_leave()
349 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
350 assert(ir->type->is_uint_16_32()); in visit_leave()
353 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
354 assert(ir->type->is_float_16_32()); in visit_leave()
357 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
358 assert(ir->type->is_boolean()); in visit_leave()
361 assert(ir->operands[0]->type->base_type == in visit_leave()
363 assert(ir->type->is_boolean()); in visit_leave()
366 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
367 assert(ir->type->is_float_16_32()); in visit_leave()
370 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
371 assert(ir->type->base_type == GLSL_TYPE_FLOAT16); in visit_leave()
374 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
375 assert(ir->type->is_boolean()); in visit_leave()
378 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
379 assert(ir->type->is_int_16_32()); in visit_leave()
382 assert(ir->operands[0]->type->is_uint_16_32()); in visit_leave()
383 assert(ir->type->is_float_16_32()); in visit_leave()
386 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
387 assert(ir->type->is_uint_16_32()); in visit_leave()
390 assert(ir->operands[0]->type->is_uint_16_32()); in visit_leave()
391 assert(ir->type->is_int_16_32()); in visit_leave()
394 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in visit_leave()
395 assert(ir->type->base_type == GLSL_TYPE_FLOAT); in visit_leave()
398 assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); in visit_leave()
399 assert(ir->type->base_type == GLSL_TYPE_INT); in visit_leave()
402 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in visit_leave()
403 assert(ir->type->base_type == GLSL_TYPE_FLOAT); in visit_leave()
406 assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT); in visit_leave()
407 assert(ir->type->base_type == GLSL_TYPE_UINT); in visit_leave()
411 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
412 assert(ir->type->is_double()); in visit_leave()
415 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
416 assert(ir->type->is_double()); in visit_leave()
419 assert(ir->operands[0]->type->is_double()); in visit_leave()
420 assert(ir->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
423 assert(ir->operands[0]->type->is_double()); in visit_leave()
424 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
427 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
428 assert(ir->type->is_int_16_32()); in visit_leave()
431 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
432 assert(ir->type->is_int_16_32()); in visit_leave()
435 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
436 assert(ir->type->is_uint_16_32()); in visit_leave()
439 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
440 assert(ir->type->is_uint_16_32()); in visit_leave()
443 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
444 assert(ir->type->is_boolean()); in visit_leave()
447 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
448 assert(ir->type->is_float()); in visit_leave()
451 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
452 assert(ir->type->is_float()); in visit_leave()
455 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
456 assert(ir->type->is_double()); in visit_leave()
459 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
460 assert(ir->type->is_double()); in visit_leave()
463 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
464 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
467 assert(ir->operands[0]->type->is_uint_16_32()); in visit_leave()
468 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
471 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
472 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
475 assert(ir->operands[0]->type->is_float()); in visit_leave()
476 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
479 assert(ir->operands[0]->type->is_double()); in visit_leave()
480 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
483 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
484 assert(ir->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
487 assert(ir->operands[0]->type->is_uint_16_32()); in visit_leave()
488 assert(ir->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
491 assert(ir->operands[0]->type->is_float()); in visit_leave()
492 assert(ir->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
495 assert(ir->operands[0]->type->is_double()); in visit_leave()
496 assert(ir->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
499 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
500 assert(ir->type->base_type == GLSL_TYPE_INT64); in visit_leave()
503 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64); in visit_leave()
504 assert(ir->type->base_type == GLSL_TYPE_UINT64); in visit_leave()
511 assert(ir->operands[0]->type->is_float_16_32_64()); in visit_leave()
512 assert(ir->operands[0]->type == ir->type); in visit_leave()
522 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
523 assert(ir->operands[0]->type == ir->type); in visit_leave()
529 assert(ir->type == glsl_type::uint_type); in visit_leave()
530 assert(ir->operands[0]->type == glsl_type::vec2_type); in visit_leave()
535 assert(ir->type == glsl_type::uint_type); in visit_leave()
536 assert(ir->operands[0]->type == glsl_type::vec4_type); in visit_leave()
540 assert(ir->type == glsl_type::double_type); in visit_leave()
541 assert(ir->operands[0]->type == glsl_type::uvec2_type); in visit_leave()
545 assert(ir->type == glsl_type::int64_t_type); in visit_leave()
546 assert(ir->operands[0]->type == glsl_type::ivec2_type); in visit_leave()
550 assert(ir->type == glsl_type::uint64_t_type); in visit_leave()
551 assert(ir->operands[0]->type == glsl_type::uvec2_type); in visit_leave()
555 assert(ir->type->is_sampler()); in visit_leave()
556 assert(ir->operands[0]->type == glsl_type::uvec2_type); in visit_leave()
560 assert(ir->type->is_image()); in visit_leave()
561 assert(ir->operands[0]->type == glsl_type::uvec2_type); in visit_leave()
567 assert(ir->type == glsl_type::vec2_type); in visit_leave()
568 assert(ir->operands[0]->type == glsl_type::uint_type); in visit_leave()
573 assert(ir->type == glsl_type::vec4_type); in visit_leave()
574 assert(ir->operands[0]->type == glsl_type::uint_type); in visit_leave()
578 assert(ir->type == glsl_type::uvec2_type); in visit_leave()
579 assert(ir->operands[0]->type == glsl_type::double_type); in visit_leave()
583 assert(ir->type == glsl_type::ivec2_type); in visit_leave()
584 assert(ir->operands[0]->type == glsl_type::int64_t_type); in visit_leave()
588 assert(ir->type == glsl_type::uvec2_type); in visit_leave()
589 assert(ir->operands[0]->type == glsl_type::uint64_t_type); in visit_leave()
593 assert(ir->type == glsl_type::uvec2_type); in visit_leave()
594 assert(ir->operands[0]->type->is_sampler()); in visit_leave()
598 assert(ir->type == glsl_type::uvec2_type); in visit_leave()
599 assert(ir->operands[0]->type->is_image()); in visit_leave()
603 assert(ir->operands[0]->type == ir->type); in visit_leave()
604 assert(ir->type->is_integer_32()); in visit_leave()
610 assert(ir->operands[0]->type->vector_elements == ir->type->vector_elements); in visit_leave()
611 assert(ir->operands[0]->type->is_integer_16_32()); in visit_leave()
612 assert(ir->type->is_int_16_32()); in visit_leave()
616 assert(ir->operands[0]->type == ir->type); in visit_leave()
617 assert(ir->type->is_uint_16_32()); in visit_leave()
621 assert(ir->operands[0]->type == ir->type); in visit_leave()
622 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
626 assert(ir->type == glsl_type::int_type); in visit_leave()
627 assert(ir->operands[0]->type == glsl_type::uint_type); in visit_leave()
631 assert(ir->type == glsl_type::int_type); in visit_leave()
632 assert(ir->operands[0]->type->is_array()); in visit_leave()
633 assert(ir->operands[0]->type->is_unsized_array()); in visit_leave()
637 assert(ir->type == glsl_type::int_type); in visit_leave()
638 assert(ir->operands[0]->type->is_array()); in visit_leave()
642 assert(ir->operands[0]->type->is_double()); in visit_leave()
643 assert(ir->type->is_float()); in visit_leave()
646 assert(ir->operands[0]->type->is_float()); in visit_leave()
647 assert(ir->type->is_double()); in visit_leave()
650 assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT16); in visit_leave()
651 assert(ir->type->is_float()); in visit_leave()
655 assert(ir->operands[0]->type->is_float()); in visit_leave()
656 assert(ir->type->base_type == GLSL_TYPE_FLOAT16); in visit_leave()
659 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
660 assert(ir->type->is_int_16_32()); in visit_leave()
661 assert(ir->type->base_type != ir->operands[0]->type->base_type); in visit_leave()
664 assert(ir->operands[0]->type->is_uint_16_32()); in visit_leave()
665 assert(ir->type->is_uint_16_32()); in visit_leave()
666 assert(ir->type->base_type != ir->operands[0]->type->base_type); in visit_leave()
669 assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT); in visit_leave()
670 assert(ir->type->base_type == GLSL_TYPE_INT16); in visit_leave()
673 assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT); in visit_leave()
674 assert(ir->type->base_type == GLSL_TYPE_UINT16); in visit_leave()
677 assert(ir->operands[0]->type->is_double()); in visit_leave()
678 assert(ir->type->is_int_16_32()); in visit_leave()
681 assert(ir->operands[0]->type->is_int_16_32()); in visit_leave()
682 assert(ir->type->is_double()); in visit_leave()
685 assert(ir->operands[0]->type->is_double()); in visit_leave()
686 assert(ir->type->is_uint_16_32()); in visit_leave()
689 assert(ir->operands[0]->type->is_uint_16_32()); in visit_leave()
690 assert(ir->type->is_double()); in visit_leave()
693 assert(ir->operands[0]->type->is_double()); in visit_leave()
694 assert(ir->type->is_boolean()); in visit_leave()
698 assert(ir->operands[0]->type->is_float_32_64()); in visit_leave()
699 assert(ir->type->is_double()); in visit_leave()
702 assert(ir->operands[0]->type->is_float_32_64()); in visit_leave()
703 assert(ir->type->base_type == GLSL_TYPE_INT); in visit_leave()
706 assert(ir->operands[0]->type->base_type == GLSL_TYPE_SUBROUTINE); in visit_leave()
707 assert(ir->type->base_type == GLSL_TYPE_INT); in visit_leave()
711 assert(ir->operands[0]->type->is_float_16_32_64()); in visit_leave()
712 assert(ir->type == ir->operands[0]->type); in visit_leave()
723 assert(ir->operands[0]->type->base_type == in visit_leave()
724 ir->operands[1]->type->base_type); in visit_leave()
726 if (ir->operation == ir_binop_mul && in visit_leave()
727 (ir->type->base_type == GLSL_TYPE_UINT64 || in visit_leave()
728 ir->type->base_type == GLSL_TYPE_INT64) && in visit_leave()
729 (ir->operands[0]->type->is_int_16_32()|| in visit_leave()
730 ir->operands[1]->type->is_int_16_32()|| in visit_leave()
731 ir->operands[0]->type->is_uint_16_32() || in visit_leave()
732 ir->operands[1]->type->is_uint_16_32())) { in visit_leave()
733 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
737 if (ir->operands[0]->type->is_scalar()) in visit_leave()
738 assert(ir->operands[1]->type == ir->type); in visit_leave()
739 else if (ir->operands[1]->type->is_scalar()) in visit_leave()
740 assert(ir->operands[0]->type == ir->type); in visit_leave()
741 else if (ir->operands[0]->type->is_vector() && in visit_leave()
742 ir->operands[1]->type->is_vector()) { in visit_leave()
743 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
744 assert(ir->operands[0]->type == ir->type); in visit_leave()
749 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
750 assert(ir->operands[0]->type->is_integer_16_32_64()); in visit_leave()
751 assert(ir->operands[0]->type->vector_elements == in visit_leave()
752 ir->type->vector_elements); in visit_leave()
753 assert(ir->type->is_uint_16_32_64()); in visit_leave()
760 assert(ir->type == ir->operands[0]->type); in visit_leave()
761 assert(ir->type == ir->operands[1]->type); in visit_leave()
762 assert(ir->type->is_integer_16_32_64()); in visit_leave()
767 assert(ir->type == ir->operands[0]->type); in visit_leave()
768 assert(ir->type == ir->operands[1]->type); in visit_leave()
769 assert(ir->type->is_integer_32()); in visit_leave()
774 assert(ir->type == ir->operands[0]->type); in visit_leave()
775 assert(ir->type == ir->operands[1]->type); in visit_leave()
776 assert(ir->type->base_type == GLSL_TYPE_UINT); in visit_leave()
788 assert(ir->type->is_boolean()); in visit_leave()
789 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
790 assert(ir->operands[0]->type->is_vector() in visit_leave()
791 || ir->operands[0]->type->is_scalar()); in visit_leave()
792 assert(ir->operands[0]->type->vector_elements in visit_leave()
793 == ir->type->vector_elements); in visit_leave()
801 assert(ir->type == glsl_type::bool_type); in visit_leave()
802 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
807 assert(ir->operands[0]->type->is_integer_16_32_64() && in visit_leave()
808 ir->operands[1]->type->is_integer_16_32()); in visit_leave()
809 if (ir->operands[0]->type->is_scalar()) { in visit_leave()
810 assert(ir->operands[1]->type->is_scalar()); in visit_leave()
812 if (ir->operands[0]->type->is_vector() && in visit_leave()
813 ir->operands[1]->type->is_vector()) { in visit_leave()
814 assert(ir->operands[0]->type->components() == in visit_leave()
815 ir->operands[1]->type->components()); in visit_leave()
817 assert(ir->type == ir->operands[0]->type); in visit_leave()
823 assert(ir->operands[0]->type->base_type == in visit_leave()
824 ir->operands[1]->type->base_type); in visit_leave()
825 assert(ir->type->is_integer_16_32_64()); in visit_leave()
826 if (ir->operands[0]->type->is_vector() && in visit_leave()
827 ir->operands[1]->type->is_vector()) { in visit_leave()
828 assert(ir->operands[0]->type->vector_elements == in visit_leave()
829 ir->operands[1]->type->vector_elements); in visit_leave()
836 assert(ir->type->is_boolean()); in visit_leave()
837 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
838 assert(ir->operands[1]->type->is_boolean()); in visit_leave()
842 assert(ir->type == glsl_type::float_type || in visit_leave()
843 ir->type == glsl_type::double_type || in visit_leave()
844 ir->type == glsl_type::float16_t_type); in visit_leave()
845 assert(ir->operands[0]->type->is_float_16_32_64()); in visit_leave()
846 assert(ir->operands[0]->type->is_vector()); in visit_leave()
847 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
851 assert(ir->operands[0]->type == glsl_type::uint_type); in visit_leave()
853 assert(ir->operands[1]->type == glsl_type::uint_type); in visit_leave()
857 assert(ir->operands[0]->type == ir->type); in visit_leave()
858 assert(ir->operands[0]->type->is_float_32_64()); in visit_leave()
859 assert(ir->operands[1]->type->base_type == GLSL_TYPE_INT); in visit_leave()
860 assert(ir->operands[0]->type->components() == in visit_leave()
861 ir->operands[1]->type->components()); in visit_leave()
865 assert(ir->operands[0]->type->is_vector()); in visit_leave()
866 assert(ir->operands[1]->type->is_scalar() in visit_leave()
867 && ir->operands[1]->type->is_integer_16_32()); in visit_leave()
871 assert(ir->operands[0]->type == ir->type); in visit_leave()
872 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
873 assert(ir->operands[1]->type->components() == 2); in visit_leave()
874 assert(ir->operands[1]->type->is_float_16_32()); in visit_leave()
878 assert(ir->operands[0]->type == ir->type); in visit_leave()
879 assert(ir->operands[0]->type->is_float_16_32()); in visit_leave()
880 assert(ir->operands[1]->type == glsl_type::int_type || in visit_leave()
881 ir->operands[1]->type == glsl_type::int16_t_type); in visit_leave()
885 assert(ir->operands[0]->type->is_float_16_32_64()); in visit_leave()
886 assert(ir->operands[1]->type == ir->operands[0]->type); in visit_leave()
887 assert(ir->type == ir->operands[0]->type); in visit_leave()
891 assert(ir->type->is_float_16_32_64()); in visit_leave()
892 assert(ir->type == ir->operands[0]->type); in visit_leave()
893 assert(ir->type == ir->operands[1]->type); in visit_leave()
894 assert(ir->type == ir->operands[2]->type); in visit_leave()
898 assert(ir->operands[0]->type->is_float_16_32_64()); in visit_leave()
899 assert(ir->operands[0]->type == ir->operands[1]->type); in visit_leave()
900 assert(ir->operands[2]->type == ir->operands[0]->type || in visit_leave()
901 ir->operands[2]->type == glsl_type::float_type || in visit_leave()
902 ir->operands[2]->type == glsl_type::double_type || in visit_leave()
903 ir->operands[2]->type == glsl_type::float16_t_type); in visit_leave()
907 assert(ir->operands[0]->type->is_boolean()); in visit_leave()
908 assert(ir->type->vector_elements == ir->operands[0]->type->vector_elements); in visit_leave()
909 assert(ir->type == ir->operands[1]->type); in visit_leave()
910 assert(ir->type == ir->operands[2]->type); in visit_leave()
914 assert(ir->type->is_integer_16_32()); in visit_leave()
915 assert(ir->operands[0]->type == ir->type); in visit_leave()
916 assert(ir->operands[1]->type == ir->type); in visit_leave()
917 assert(ir->operands[2]->type == ir->type); in visit_leave()
921 assert(ir->operands[0]->type->is_vector()); in visit_leave()
922 assert(ir->operands[1]->type->is_scalar()); in visit_leave()
923 assert(ir->operands[0]->type->base_type == ir->operands[1]->type->base_type); in visit_leave()
924 assert(ir->operands[2]->type->is_scalar() in visit_leave()
925 && ir->operands[2]->type->is_integer_16_32()); in visit_leave()
926 assert(ir->type == ir->operands[0]->type); in visit_leave()
930 assert(ir->type->is_integer_16_32()); in visit_leave()
931 assert(ir->operands[0]->type == ir->type); in visit_leave()
932 assert(ir->operands[1]->type == ir->type); in visit_leave()
933 assert(ir->operands[2]->type == ir->type); in visit_leave()
934 assert(ir->operands[3]->type == ir->type); in visit_leave()
945 switch (ir->type->vector_elements) { in visit_leave()
947 assert(ir->operands[0]->type->is_scalar()); in visit_leave()
948 assert(ir->operands[0]->type->base_type == ir->type->base_type); in visit_leave()
949 assert(ir->operands[1] == NULL); in visit_leave()
950 assert(ir->operands[2] == NULL); in visit_leave()
951 assert(ir->operands[3] == NULL); in visit_leave()
954 assert(ir->operands[0]->type->is_scalar()); in visit_leave()
955 assert(ir->operands[0]->type->base_type == ir->type->base_type); in visit_leave()
956 assert(ir->operands[1]->type->is_scalar()); in visit_leave()
957 assert(ir->operands[1]->type->base_type == ir->type->base_type); in visit_leave()
958 assert(ir->operands[2] == NULL); in visit_leave()
959 assert(ir->operands[3] == NULL); in visit_leave()
962 assert(ir->operands[0]->type->is_scalar()); in visit_leave()
963 assert(ir->operands[0]->type->base_type == ir->type->base_type); in visit_leave()
964 assert(ir->operands[1]->type->is_scalar()); in visit_leave()
965 assert(ir->operands[1]->type->base_type == ir->type->base_type); in visit_leave()
966 assert(ir->operands[2]->type->is_scalar()); in visit_leave()
967 assert(ir->operands[2]->type->base_type == ir->type->base_type); in visit_leave()
968 assert(ir->operands[3] == NULL); in visit_leave()
971 assert(ir->operands[0]->type->is_scalar()); in visit_leave()
972 assert(ir->operands[0]->type->base_type == ir->type->base_type); in visit_leave()
973 assert(ir->operands[1]->type->is_scalar()); in visit_leave()
974 assert(ir->operands[1]->type->base_type == ir->type->base_type); in visit_leave()
975 assert(ir->operands[2]->type->is_scalar()); in visit_leave()
976 assert(ir->operands[2]->type->base_type == ir->type->base_type); in visit_leave()
977 assert(ir->operands[3]->type->is_scalar()); in visit_leave()
978 assert(ir->operands[3]->type->base_type == ir->type->base_type); in visit_leave()
993 ir_validate::visit_leave(ir_swizzle *ir) in visit_leave() argument
995 unsigned int chans[4] = {ir->mask.x, ir->mask.y, ir->mask.z, ir->mask.w}; in visit_leave()
997 for (unsigned int i = 0; i < ir->type->vector_elements; i++) { in visit_leave()
998 if (chans[i] >= ir->val->type->vector_elements) { in visit_leave()
1000 "in the value.\n", (void *) ir); in visit_leave()
1001 ir->print(); in visit_leave()
1010 ir_validate::visit(ir_variable *ir) in visit() argument
1017 if (ir->name && ir->is_name_ralloced()) in visit()
1018 assert(ralloc_parent(ir->name) == ir); in visit()
1020 _mesa_set_add(ir_set, ir); in visit()
1026 if (ir->type->array_size() > 0) { in visit()
1027 if (ir->data.max_array_access >= (int)ir->type->length) { in visit()
1029 ir->data.max_array_access, ir->type->length - 1); in visit()
1030 ir->print(); in visit()
1039 if (ir->is_interface_instance()) { in visit()
1041 ir->get_interface_type()->fields.structure; in visit()
1042 for (unsigned i = 0; i < ir->get_interface_type()->length; i++) { in visit()
1046 ir->get_max_ifc_array_access(); in visit()
1054 ir->print(); in visit()
1061 if (ir->constant_initializer != NULL && !ir->data.has_initializer) { in visit()
1064 ir->print(); in visit()
1068 if (ir->data.mode == ir_var_uniform in visit()
1069 && is_gl_identifier(ir->name) in visit()
1070 && ir->get_state_slots() == NULL) { in visit()
1072 ir->print(); in visit()
1080 ir_validate::visit_enter(ir_assignment *ir) in visit_enter() argument
1082 const ir_dereference *const lhs = ir->lhs; in visit_enter()
1084 if (ir->write_mask == 0) { in visit_enter()
1087 ir->print(); in visit_enter()
1093 if (ir->write_mask & (1 << i)) in visit_enter()
1097 if (lhs_components != ir->rhs->type->vector_elements) { in visit_enter()
1100 lhs_components, ir->rhs->type->vector_elements); in visit_enter()
1101 ir->print(); in visit_enter()
1106 if (lhs->type->base_type != ir->rhs->type->base_type) { in visit_enter()
1110 ir->rhs->print(); in visit_enter()
1115 this->validate_ir(ir, this->data_enter); in visit_enter()
1121 ir_validate::visit_enter(ir_call *ir) in visit_enter() argument
1123 ir_function_signature *const callee = ir->callee; in visit_enter()
1130 if (ir->return_deref) { in visit_enter()
1131 if (ir->return_deref->type != callee->return_type) { in visit_enter()
1133 callee->return_type->name, ir->return_deref->type->name); in visit_enter()
1142 const exec_node *actual_param_node = ir->actual_parameters.get_head_raw(); in visit_enter()
1174 ir->print(); in visit_enter()
1182 ir_validate::validate_ir(ir_instruction *ir, void *data) in validate_ir() argument
1186 if (_mesa_set_search(ir_set, ir)) { in validate_ir()
1188 ir->print(); in validate_ir()
1192 _mesa_set_add(ir_set, ir); in validate_ir()
1196 check_node_type(ir_instruction *ir, void *data) in check_node_type() argument
1200 if (ir->ir_type >= ir_type_max) { in check_node_type()
1202 ir->print(); printf("\n"); in check_node_type()
1204 ir_rvalue *value = ir->as_rvalue(); in check_node_type()
1224 foreach_in_list(ir_instruction, ir, instructions) { in validate_ir_tree()
1225 visit_tree(ir, check_node_type, NULL); in validate_ir_tree()