[llvm-dev] [GlobalISel] Predicated TImmLeafs in patterns

Dominik Montada via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 23:50:24 PST 2020


Hi Daniel,

yep the pattern is being imported. When I investigated this further I 
noticed that the GISel backend is able to handle TImms, but is not 
creating any predicates for them. I created 
https://reviews.llvm.org/D91703 to teach the backend how to create those 
predicates.

Cheers,

Dominik

Am 02.12.20 um 05:52 schrieb Daniel Sanders:
> Hi Dominik,
>
> Are you sure that Pat is being imported? TImmLeaf is a subclass of ImmLeaf/PatFrag/PatFrags so there needs to be an equivalent predicate check in the GISelPredicateCode field to be imported. IntImmLeaf/FPImmLeaf on the other hand can share the same code for DAGISel and GlobalISel because the difference between the two ISel's were abstracted out for those classes.
>
>> On Nov 17, 2020, at 08:15, Dominik Montada via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> Hi,
>>
>> I'm trying to use predicated TImmLeafs in TableGen patterns with GlobalISel to select intrinsics with immediate operands. While this is working so far, contrary to ImmLeafs the predicate does not seem to get checked. Is this not supported yet?
>>
>> This is the pattern in question:
>>
>> def tuimm9 : TImmLeaf<i32, [{ return isUInt<9>(Imm); }]>;
>> def : Pat<(int_target_foo tuimm9:$mask), (FOO tuimm9:$mask)>;
>>
>> Match table when using TImmLeaf:
>>
>> GIM_CheckIsImm,
>>
>> Match table when using ImmLeaf:
>>
>> GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_CONSTANT,
>> GIM_CheckI64ImmPredicate, /*MI*/1, /*Predicate*/GIPFP_I64_Predicate_uimm9,
>>
>> Basically I'm wondering how I can make TableGen generate the GIM_CheckI64ImmPredicate when using TImmLeafs.
>>
>> Cheers,
>>
>> Dominik
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-- 
----------------------------------------------------------------------
Dominik Montada                   Email: dominik.montada at hightec-rt.com
HighTec EDV-Systeme GmbH          Phone: +49 681 92613 19
Europaallee 19                    Fax:   +49-681-92613-26
D-66113 Saarbrücken               WWW: http://www.hightec-rt.com

Managing Director: Vera Strothmann
Register Court: Saarbrücken, HRB 10445, VAT ID: DE 138344222

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient please notify the sender immediately
and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
---

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201202/ab31d504/attachment.bin>


More information about the llvm-dev mailing list