authorgravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2018-06-30 21:22:26+02:00
committergravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2018-06-30 21:22:26+02:00
log055e0fef4eaa2d8c6dcbd83180baa44d88be3b4d
treef2cc0169f513598374133b577979ec604e9315cc
parentecd5e60be9cab03449e0d40a770c5a0c5582198d

Avoid resolve_const in cmp when instr are not comptime


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

src/ir.cpp+2-2
......@@ -11029,10 +11029,10 @@ static TypeTableEntry *ir_analyze_bin_op_cmp(IrAnalyze *ira, IrInstructionBinOp
1102911029
1103011030 bool one_possible_value = !type_requires_comptime(resolved_type) && !type_has_bits(resolved_type);
1103111031 if (one_possible_value || (instr_is_comptime(casted_op1) && instr_is_comptime(casted_op2))) {
11032 ConstExprValue *op1_val = ir_resolve_const(ira, casted_op1, UndefBad);
11032 ConstExprValue *op1_val = one_possible_value ? &casted_op1->value : ir_resolve_const(ira, casted_op1, UndefBad);
1103311033 if (op1_val == nullptr)
1103411034 return ira->codegen->builtin_types.entry_invalid;
11035 ConstExprValue *op2_val = ir_resolve_const(ira, casted_op2, UndefBad);
11035 ConstExprValue *op2_val = one_possible_value ? &casted_op2->value : ir_resolve_const(ira, casted_op2, UndefBad);
1103611036 if (op2_val == nullptr)
1103711037 return ira->codegen->builtin_types.entry_invalid;
1103811038