[llvm] r318398 - [ARM GlobalISel] Add tests for BIC. NFC

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 02:25:55 PST 2017


On 20 November 2017 at 21:36, Friedman, Eli <efriedma at codeaurora.org> wrote:
> On 11/20/2017 1:44 AM, Diana Picus wrote:
>>
>> Hi Eli,
>>
>> This is supposed to test the code generated by TableGen for
>> defm BIC   : AsI1_bin_irs<0b1110, "bic",
>>                            IIC_iBITi, IIC_iBITr, IIC_iBITsr,
>>                            BinOpFrag<(and node:$LHS, (not node:$RHS))>>;
>> where 'not' is a 'xor' with -1 (we don't have a G_NOT opcode).
>>
>> I agree that it looks weird and not very likely to occur much in
>> practice, but I think it's useful for making sure that TableGen does
>> what we'd expect for AsI1_bin_irs with a BinOpFrag as opposed to just
>> a simple node like the other AsI1_bin_irs patterns.
>
>
> The pattern we normally use to match BICri is a separate pattern, "(and
> GPR:$src, mod_imm_not:$imm)".  I didn't realize we actually generated a
> pattern for NOT of an i32 immediate; it's not a pattern which would ever
> match with SelectionDAG.
>
> Please add a comment noting this.  And please add a testcase for the BICri
> pattern we normally use.

I added a comment in r318747, I hope it manages to describe the
situation accurately enough. Feel free to edit it if you can make it
more expressive.

I can't add a testcase for the other BICri pattern at the moment
because it's not supported by the GlobalISel emitter yet (it doesn't
like mod_imm_not). My intention is to periodically check back on the
TableGen support and add more test cases as we go along.

Thanks,
Diana

>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>


More information about the llvm-commits mailing list