[PATCH] D6407: [InstCombine] Minor optimization for bswap with binary ops

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 05:30:37 PDT 2022


lebedev.ri added a comment.

In D6407#3378725 <https://reviews.llvm.org/D6407#3378725>, @deeprobin wrote:

> In D6407#3377819 <https://reviews.llvm.org/D6407#3377819>, @lebedev.ri wrote:
>
>> In D6407#3377769 <https://reviews.llvm.org/D6407#3377769>, @deeprobin wrote:
>>
>>> @xbolva00 @RKSimon
>>>
>>>> 8 year old patch…
>>>
>>> Yes I would be interested in the real-world case behind this.
>>>
>>>>>> No developer will …
>>>>
>>>> Very strong words :D
>>>
>>> The question is whether this is a niche optimization or whether there is some common code pattern that justifies that this is not a niche optimization.
>>
>> Perhaps it would be more productive to approach this from another angle - what prompted you to bring this up?
>
> I generally have different scenarios in C# (even rare ones) and came up with that the .NET runtime does not optimize duplicate bswaps.
> In the runtime niche optimizations are done rather rarely, so I wanted to see for what reason LLVM has this built in.
>
> See https://github.com/dotnet/runtime/issues/66249

That issue is about `bswap(bswap(x)) --> x`, this patch was for `logic(bswap(x), bswap(y)) --> bswap(logic(x, y))`.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D6407



More information about the llvm-commits mailing list