[PATCH] D85203: TableGen/GlobalISel: Allow inst matcher to check multiple opcodes

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 15:04:21 PDT 2020


paquette added a comment.

In D85203#2200550 <https://reviews.llvm.org/D85203#2200550>, @arsenm wrote:

> In D85203#2200542 <https://reviews.llvm.org/D85203#2200542>, @paquette wrote:
>
>> Could we have more than 2 possible choices for opcodes? Would it make sense to make this take an arbitrary number of alternatives?
>>
>> Maybe something like
>>
>>   /// - InsnID - Instruction ID
>>   /// - NumChoices - Number of possible opcodes
>>   /// - Opcode1, Opcode2, Opcode3, ... OpcodeNumChoices - Possible opcodes, ordered by preference
>>   GIM_CheckOpcodeWithAlternatives
>>
>> I can't think of anything off the top of my head, but it could be useful I suppose.
>
> I considered doing it this way, but I couldn't come up with a case where we would need more than 2. I'd rather use the simpler thing unless there's a concrete need

Ok, that seems reasonable to me.

Do you think you can change the name from GIM_CheckOpcode2 to something more descriptive?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85203/new/

https://reviews.llvm.org/D85203



More information about the llvm-commits mailing list