aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ir_inliner.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-03-21 22:20:34 +0100
committerlemon <lsof@mailbox.org>2026-03-22 10:49:26 +0100
commit79874c83bf76a5b3efd3d558933b90d9b53b829e (patch)
tree566930a17f1e090f86c2051ffec33106012908eb /src/ir_inliner.c
parent83342d3b60438ef2421160a0673fb45d48b2f39f (diff)
IR: add 3rd operand to Instr
The motivation is for aarch64 msub/madd instrs, for isel to produce. But it should be useful for other things too.
Diffstat (limited to 'src/ir_inliner.c')
-rw-r--r--src/ir_inliner.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ir_inliner.c b/src/ir_inliner.c
index c3e0777..db89479 100644
--- a/src/ir_inliner.c
+++ b/src/ir_inliner.c
@@ -125,7 +125,7 @@ inlcall(Function *fn, Block *blk, int curi, SavedFunc *sv)
Instr *ins = &instrtab[blk->ins.p[i]];
if (ins->op == Oarg) {
args[--n] = ins->r;
- *ins = mkinstr(Onop,0,);
+ *ins = mkinstr0(Onop,0);
}
}
if (call->abiret[1].ty.bits) {
@@ -135,14 +135,14 @@ inlcall(Function *fn, Block *blk, int curi, SavedFunc *sv)
}
Block *exit = blksplitafter(fn, blk, curi-1);
if (!ins->cls) {
- *ins = mkinstr(Onop,0,);
+ *ins = mkinstr0(Onop,0);
} else {
if (sv->nretpoints == 1) {
- *ins = mkinstr(Ocopy, ins->cls, );
+ *ins = mkinstr1(Ocopy, ins->cls, NOREF);
} else {
/* turn into a phi */
- *ins = mkinstr(Ophi, ins->cls, );
- exit->ins.p[0] = newinstr(blk, mkinstr(Onop,0,));
+ *ins = mkinstr1(Ophi, ins->cls, NOREF);
+ exit->ins.p[0] = newinstr(blk, mkinstr0(Onop,0));
vpush(&exit->phi, res);
}
}
@@ -187,7 +187,7 @@ inlcall(Function *fn, Block *blk, int curi, SavedFunc *sv)
for (int i = 0; i < b->npred; ++i)
refs[i] = mapref(instrmap, sv, src[i]);
vpush(&phitab, refs);
- instrtab[instrmap[t]] = mkinstr(Ophi, sv->instrtab[t].cls, .l.i = phitab.n-1);
+ instrtab[instrmap[t]] = mkinstr1(Ophi, sv->instrtab[t].cls, {.i = phitab.n-1});
new->phi.p[i] = instrmap[t];
}
vresize(&new->ins, b->ins.n);