I have written such code in td file:
def : Pat<(and (shiftop<srl> GPR:$rs1, uimm5:$iloc), uimm5:$ilen),
(EBI GPR:$rs1, uimm5:$ilen, uimm5:$iloc)>;
In hoping to convert such ll code:
%1 = lshr i32 %rs1, 5
%and = and i32 %1, 2
To:
ebi a0, a0, 2, 5
But what I got is like this:
li a1, 5
ebi a0, a0, 2, a1
i.e, an extra instruction is created to load ‘5’ into register.
What’s the problem in my code for td file?
Thanks,
Baoshan