I think I have answered my own questions below, but now have additional questions,
I am now using : let Constraints = “$src = $dst”; following examples from X86,
rather than TwoOperandAliasConstraint that I had been following from Mips,
and I am now seeing TIED_TO in my GenInstrInfo.inc for the appropriate OperandInfo’s,
but I am still seeing assembly code emitted that violates this constraint,
what else am I missing ?
thanks, Peter Lawrence.
the only thing I see that is out-of-the-ordinary in my GenInstrInfo.inc is
the OPERAND_MEMORY rather than OPERAND_REGISTER for my base-register operand
and OPERAND_MEMORY rather than OPERAND_IMMEDIATE for my offset operand,
but am still not sure how that happens or what to do to fix it ?
static const MCOperandInfo OperandInfo25[] = {
{ Xmc::AddrRegsRegClassID, 0, MCOI::OPERAND_REGISTER, 0 },
{ Xmc::AddrRegsRegClassID, 0, MCOI::OPERAND_MEMORY, ((0 << 16) | (1 << MCOI::TIED_TO)) },
{ -1, 0, MCOI::OPERAND_MEMORY, 0 }, };
I seem to be between a rock and a hard place:
let OperandType = “OPERAND_MEMORY” in { <----- I suspect my MEMORY_OPERAND comes from this
def memri : Operand {
let MIOperandInfo = (ops addrreg:$base, i16imm:$offset); }
}
def LEA : FMT_I6 <0x4c00, (outs addrreg:$dst), (ins memri:$addr), <----- I suspect the fix would be to split the memri
----- into separate reg and imm “ins” operands,
“lea $dst, ${addr:arith}”,
[(set iPTR:$dst, addrri:$addr)]> { <----- but then I would not be able to write this pattern
----- and ISel would fail ???
let Constraints = “$addr.base = $dst”;
let isCodeGenOnly = 1;
}
– Sleepless in Silicon Valley…