[PATCH] Passing down BinaryOperator flags to BinarySDNode + X86 optimization

Marcello Maggioni hayarms at gmail.com
Mon Jun 2 17:01:52 PDT 2014


Hi, thanks Daniil for your review!

1) Yeah, I also kind of like what you proposed more ... I used the approach
that is used currently in BinaryOperator for that. I'm not sure if it is
better to change both to this format or having them to diverge (keeping
BinaryOperator like it was and changing this one to the syntax you
proposed).

2) Thanks for spotting those stylistic inconsistencies! I'm working on a
new setup and I think I still have to tune some of my editor default
settings ...

3) What you mean exactly with this one?

PS = Here are some updated patches with concerns number 1 and 2 addressed.

Thanks,
Marcello


2014-06-02 17:00 GMT-07:00 Marcello Maggioni <hayarms at gmail.com>:

> Hi, thanks Daniil for your review!
>
> 1) Yeah, I also kind of like what you proposed more ... I used the
> approach that is used currently in BinaryOperator for that. I'm not sure if
> it is better to change both to this format or having them to diverge
> (keeping BinaryOperator like it was and changing this one to the syntax you
> proposed).
>
> 2) Thanks for spotting those stylistic inconsistencies! I'm working on a
> new setup and I think I still have to tune some of my editor default
> settings ...
>
> 3) What you mean exactly with this one?
>
> PS = Here are some updated patches with concerns number 1 and 2 addressed.
>
> Thanks,
> Marcello
>
>
> 2014-06-02 2:36 GMT-07:00 Данил Трошков <troshkovdanil at mail.ru>:
>
>  1)
>>
>>      (SubclassData & ~NUW) | (b * NUW);
>> Maybe better to write somehow
>>
>> (SubclassData & ~NUW) | (b ? NUW : 0);
>> IMHO it is more readable
>>
>> 2) const BinarySDNode *BinNode = static_cast<const BinarySDNode*>(N);
>> formatting: \t...
>> +                BinNode->hasNoUnsignedWrap(),
>> +         BinNode->hasNoSignedWrap(),
>> +         BinNode->isExact());
>> the same...
>> +                    bool nsw, bool exact) {
>> +          bool nsw, bool exact) {
>> +        Op1, Op2, HasNUW, HasNSW, IsExact);
>> + if (BinNode->hasNoSignedWrap())
>> +   break;
>>
>> 3) Maybe better to remove bundle of cases on low level?
>> In order to reduce duplication of code...
>>
>>
>>
>> Sat, 31 May 2014 19:30:24 -0700 от Marcello Maggioni <hayarms at gmail.com>:
>>
>>   Here an updated patch.
>>
>> The changes are:
>>
>> - I stripped away the new getBinaryNode function and integrated the
>> functionality in the getNode() function with two operands.
>> - I removed the refactoring for the binary folding logic. Removing
>> getBinaryNode() makes putting that logic in an external function not
>> needed. (this also fixes the clang-format problem Owen pointed out).
>> - Cleaned up some stuff and fixed some style problems.
>> - Integrated the changes Pete pointed out:
>>   - Added the flags to the NodeID construction
>>   - Created a test case for the CSE (not sure it is the best test though
>> ... I'm not an expert testing this kind of stuff)
>>   - Merged the test for the performance optimization in the optimization
>> patch.
>>   - Integrated the code cleanups that were specified.
>>   - Reduced the test case for the x86 opt.
>>
>> Now as a result there are only two patches:
>>   - flag_nodes.patch
>>   - x86_opt_wrap.patch
>>
>> I didn't changed BinarySDNode to have classof(), because I think is
>> probably better doing it separately , but also because it is kind of more
>> complex than it seems , because it is not clear exactly what are the
>> opcodes that become BinarySDNodes (a part from the obvious binary ADD, SUB
>> ... etc operations).
>> It is probably necessary to take more time to collect an accurate list of
>> all the opcodes that always end up being lowered as BinarySDNodes and add
>> the classof() then.
>>
>> Marcello
>>
>>
>>  _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> <https://e.mail.ru/compose?To=llvm%2dcommits@cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/4e6a6054/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flag_nodes_v2.patch
Type: application/octet-stream
Size: 12270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/4e6a6054/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x86_opt_wrap_v2.patch
Type: application/octet-stream
Size: 2774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140602/4e6a6054/attachment-0001.obj>


More information about the llvm-commits mailing list