[PATCH] D116194: [InstCombine] Factor out a common pattern match used 3 times. NFC.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 6 09:00:15 PST 2022


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

In D116194#3223711 <https://reviews.llvm.org/D116194#3223711>, @rampitec wrote:

> In D116194#3223354 <https://reviews.llvm.org/D116194#3223354>, @spatel wrote:
>
>> Making the caller pass a dummy seems awkward. 
>> I don't have any suggestions to improve it, but adding some more potential reviewers.
>
> I can pass a pointer with default null. Is that better?

Wouldn't it be a pointer to a pointer in that case? 
Since we already have 'X' in the caller, we could just always pass 'X' instead of using 'Dummy' even if it is not used.
I don't have a strong opinion on it, so LGTM. 
 Although I am still hoping we can find an alternative to complicated (yet ultimately still fragile) pattern-matching that is trying to work around limits of reassociation and multi-use.


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

https://reviews.llvm.org/D116194



More information about the llvm-commits mailing list