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
signature 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 *
1348013480 }
1348113481
1348213482 if (one_possible_value || (instr_is_comptime(casted_op1) && instr_is_comptime(casted_op2))) {
13483 // TODO do we need lazy values on vector comparisons?
13484 if (resolved_type->id != ZigTypeIdVector) {
13483 {
1348513484 // Before resolving the values, we special case comparisons against zero. These can often be done
1348613485 // without resolving lazy values, preventing potential dependency loops.
1348713486 Cmp op1_cmp_zero;
......@@ -13589,11 +13588,12 @@ never_mind_just_calculate_it_normally:
1358913588 IrInstruction *result = ir_build_bin_op(&ira->new_irb,
1359013589 bin_op_instruction->base.scope, bin_op_instruction->base.source_node,
1359113590 op_id, casted_op1, casted_op2, bin_op_instruction->safety_check_on);
13592 if (resolved_type->id == ZigTypeIdVector)
13591 if (resolved_type->id == ZigTypeIdVector) {
1359313592 result->value.type = get_vector_type(ira->codegen, resolved_type->data.vector.len,
1359413593 ira->codegen->builtin_types.entry_bool);
13595 else
13594 } else {
1359613595 result->value.type = ira->codegen->builtin_types.entry_bool;
13596 }
1359713597 return result;
1359813598}
1359913599