Skip to content

Commit

Permalink
important
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander.nutz committed Jun 5, 2024
1 parent 388fe2a commit 0537e2d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
7 changes: 5 additions & 2 deletions ir/ir.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,11 @@ struct vx_IrOp_s {
#define FOR_PARAMS(op,want,paramn,fn) { \
vx_IrName __names[] = want; \
for (size_t __it = 0; __it < sizeof(__names) / sizeof(vx_IrName); __it ++) { \
vx_IrValue paramn = *vx_IrOp_param(op, __names[__it]); \
fn; \
vx_IrValue *__param = vx_IrOp_param(op, __names[__it]); \
if (__param) {\
vx_IrValue paramn = *__param; \
fn; \
}\
} \
}

Expand Down
2 changes: 0 additions & 2 deletions ir/transform/single_assign_conditional.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ vx_OptIrVar vx_CIrBlock_mksa_states(vx_IrBlock *block)
continue;

// inside out:
assert(ifOp->params_len >= 2);
assert(ifOp->params_len <= 3);

FOR_PARAMS(ifOp, MKARR(VX_IR_NAME_COND_THEN, VX_IR_NAME_COND_ELSE), param, {
vx_IrBlock *conditional = param.block;
Expand Down
14 changes: 5 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ void eq(int a, int b, int c, int d) {
return block;
}

static int cir_test(void) {
vx_IrBlock *block = build_test_bool();

static int cir_test(vx_IrBlock *block) {
if (vx_cir_verify(block) != 0)
return 1;

Expand Down Expand Up @@ -223,13 +221,11 @@ int main(void) {
ty_bool->base.align = 2; // depends on arch
ty_bool->base.size = 1;

printf("C-IR test:\n");
if (cir_test() != 0)
return 1;
printf("==== BOOL TEST ====\n");
cir_test(build_test_bool());

//printf("\nSSA-IR test:\n");
//if (ir_test() != 0)
// return 1;
printf("==== CMOV TEST ====\n");
cir_test(build_test_cmov());

return 0;
}

0 comments on commit 0537e2d

Please sign in to comment.