mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Fix SCCP support for IF with integer and floating point condition
This commit is contained in:
parent
dee45adc8c
commit
a998590dfb
@ -142,6 +142,12 @@ static bool ir_sccp_is_true(ir_ctx *ctx, ir_insn *_values, ir_ref a)
|
||||
|
||||
if (v->type == IR_BOOL) {
|
||||
return v->val.b;
|
||||
} else if (IR_IS_TYPE_INT(v->type)) {
|
||||
return v->val.i64 != 0;
|
||||
} else if (v->type == IR_DOUBLE) {
|
||||
return v->val.d != 0.0;
|
||||
} else if (v->type == IR_FLOAT) {
|
||||
return v->val.f != 0.0;
|
||||
}
|
||||
IR_ASSERT(0 && "NYI");
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user