[llvm] r237423 - Add SDNodes for umin, umax, smin and smax.

James Molloy James.Molloy at arm.com
Thu Jun 4 06:52:28 PDT 2015


Hi Matt,

Apologies, this looks like a think-o on my part. You’re right, it should be SDAGBuilder’s job to filter out cases where the condition has multiple users.

I’ve committed a fix for this in r239037.

Cheers,

James

On 3 Jun 2015, at 21:59, Matt Arsenault <arsenm2 at gmail.com> wrote:

>
>> On May 15, 2015, at 2:03 AM, James Molloy <james.molloy at arm.com> wrote:
>>
>>
>> -  for (unsigned i = 0; i != NumValues; ++i)
>> +  // Min/max matching is only viable if all output VTs are the same.
>> +  if (std::equal(ValueVTs.begin(), ValueVTs.end(), ValueVTs.begin())) {
>> +    Value *LHS, *RHS;
>> +    SelectPatternFlavor SPF = matchSelectPattern(const_cast<User*>(&I), LHS, RHS);
>> +    ISD::NodeType Opc = ISD::DELETED_NODE;
>> +    switch (SPF) {
>> +    case SPF_UMAX: Opc = ISD::UMAX; break;
>> +    case SPF_UMIN: Opc = ISD::UMIN; break;
>> +    case SPF_SMAX: Opc = ISD::SMAX; break;
>> +    case SPF_SMIN: Opc = ISD::SMIN; break;
>> +    default: break;
>> +    }
>> +
>
> Hi,
>
> I’m trying to port R600’s target nodes to use this and hitting a problem from this. matchSelectPattern always matches, even if the condition has multiple uses. If you do something else to the condition besides the min/max, this increases the instruction count. What is the intended behavior / other uses of matchSelectPattern? Should it be rejecting cases with multiple condition uses, or should these cases be filtered out here in SelectionDAGBuilder?
>
> -Matt
>


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782





More information about the llvm-commits mailing list