authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-18 10:52:32-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-09-18 10:54:45-04:00
log9e4065fa738f040dd338c613409fc1089cc33580
tree8c5e7343e68a4e889259fa48b75fd31758a9de3f
parent74ce5e9e13014d2657bf00b5893fd4687c7f0359
signaturelock-open Commit is signed but in an unrecognized format.

remove TODO regarding lazy values

The question was: > // TODO do we need lazy values on vector comparisons? Nope, in fact the existing code already was returning ErrorNotLazy for that particular type, and would already goto never_mind_just_calculate_it_normally. So the explicit check for ZigTypeIdVector is not needed. I appreciate the caution though.

1 files changed, 4 insertions(+), 4 deletions(-)

src/ir.cpp+4-4
...@@ -13480,8 +13480,7 @@ static IrInstruction *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp *...@@ -13480,8 +13480,7 @@ static IrInstruction *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp *
13480 }13480 }
1348113481
13482 if (one_possible_value || (instr_is_comptime(casted_op1) && instr_is_comptime(casted_op2))) {13482 if (one_possible_value || (instr_is_comptime(casted_op1) && instr_is_comptime(casted_op2))) {
13483 // TODO do we need lazy values on vector comparisons?13483 {
13484 if (resolved_type->id != ZigTypeIdVector) {
13485 // Before resolving the values, we special case comparisons against zero. These can often be done13484 // Before resolving the values, we special case comparisons against zero. These can often be done
13486 // without resolving lazy values, preventing potential dependency loops.13485 // without resolving lazy values, preventing potential dependency loops.
13487 Cmp op1_cmp_zero;13486 Cmp op1_cmp_zero;
...@@ -13589,11 +13588,12 @@ never_mind_just_calculate_it_normally:...@@ -13589,11 +13588,12 @@ never_mind_just_calculate_it_normally:
13589 IrInstruction *result = ir_build_bin_op(&ira->new_irb,13588 IrInstruction *result = ir_build_bin_op(&ira->new_irb,
13590 bin_op_instruction->base.scope, bin_op_instruction->base.source_node,13589 bin_op_instruction->base.scope, bin_op_instruction->base.source_node,
13591 op_id, casted_op1, casted_op2, bin_op_instruction->safety_check_on);13590 op_id, casted_op1, casted_op2, bin_op_instruction->safety_check_on);
13592 if (resolved_type->id == ZigTypeIdVector)13591 if (resolved_type->id == ZigTypeIdVector) {
13593 result->value.type = get_vector_type(ira->codegen, resolved_type->data.vector.len,13592 result->value.type = get_vector_type(ira->codegen, resolved_type->data.vector.len,
13594 ira->codegen->builtin_types.entry_bool);13593 ira->codegen->builtin_types.entry_bool);
13595 else13594 } else {
13596 result->value.type = ira->codegen->builtin_types.entry_bool;13595 result->value.type = ira->codegen->builtin_types.entry_bool;
13596 }
13597 return result;13597 return result;
13598}13598}
1359913599