"Didn't provide enough results" assertion


I am getting this assertion when building my project: `Ops.size() >= NumSrcResults && “Didn’t provide enough results”’

this is the instruction that causes it:

def ASTI: F<0b100001,(outs),(ins i32imm:$i10s),“ASTI $i10s”,[(set SP, (i32 (add (i32 SP), (i32 sext12To32Trunc2imm:$i10s))))] > {

let isReMaterializable = 1;

let mayLoad = 0;

let mayStore = 0;

let Defs = [SP];

let Uses = [SP];


I’ve been staring at it for a while and can’t identify what the problem is. It is supposed to add an immediate to the SP and store the result back in SP (i.e. SP = SP + i10s). When I print Ops.size() and NumSrcResults, I get 0 and 2


Quick update: If I add an output register, the assertion goes away.

def ASTI: F<0b100001,(outs CPURegs:$ra),(ins i32imm:$i10s),“ASTI $i10s”,[(set CPURegs:$ra, (i32 (add (i32 SP), (i32 sext12To32Trunc2imm:$i10s))))] > {

Why can’t this instruction be without output register?