[llvm-dev] generating multiple instructions for a single pattern
David Chisnall via llvm-dev
llvm-dev at lists.llvm.org
Fri Mar 2 03:29:27 PST 2018
On 2 Mar 2018, at 11:09, Nagaraju Mekala via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> I am working on a target which requires to generated two
> instructions for a single branch instruction.
> ex:
> imm 1
> br r4,0xabcd
> branch address is 0x1abcd, imm has the upper 16 bits and br has
> lower 16 bits.
>
> Can anyone let me know how to write these kind of patterns in the
> InstrInfo.td file.
Do the two instructions need to be together? Is one providing an operand via an implicit register?
If the two are simply a sequence that must be emitted together, then the easiest thing to do is make it a pseudo and then expand it into two instructions later. If one is really providing part of the operand via an implicit register, then it’s best to describe that directly and let the scheduler decide where to put the first instruction.
David
More information about the llvm-dev
mailing list