[llvm-dev] InstAlias with tied operands - can it be supported?

Daniel Sanders via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 15 03:40:01 PST 2017


Hi,

On Instructions you can use checkEarlyTargetMatchPredicate() to check that the operands are the same. There's an example of that in MipsAsmParser.cpp for DATI and DAHI. I can't think of a reason TableGen couldn't be made to allow this for InstAlias too.

> On 15 Dec 2017, at 02:12, via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hello,
> 
> InstAlias does not allow tied operands (repeated operands) in the asm string to be matched.
> 
> It seems this situation is explicitly prevented in AsmMatcherEmitter.cpp:
> 
>   if  (!Hack)
>        PrintFatalError(TheDef->getLoc(),
>                        "ERROR: matchable with tied operand '" + Tok +
>                        "' can never be matched!");
>      // FIXME: Should reject these.  The ARM backend hits this with $lane in a
>      // bunch of instructions.  It is unclear what the right answer is.
>> 
> Is there a way to fix this limitation?
> 
> I would like to express: InstAlias<(opcode $rd, $rd, $rs1), (newopcode $rd, $rs1)>
> 
> Thank you,
> Ana.
> 
> 
> -- 
> Ana Pazos
> Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list