[PATCH] D96405: [DAGCombiner] Reduce Shuffle_Vector Nodes Count

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 18:26:57 PST 2021


craig.topper added a comment.

In D96405#2599708 <https://reviews.llvm.org/D96405#2599708>, @mmarjieh wrote:

> In D96405#2565621 <https://reviews.llvm.org/D96405#2565621>, @lebedev.ri wrote:
>
>> This doesn't seem like the right direction,
>> i'd expect that to be a new fold to reduce shuffle count,
>> because if we only teach some existing fold to do this,
>> we'll miss such shuffle patterns that appear via other means.
>
> Agreed.
> I added a separate combine for this.
> I am still not sure what is the best DAGCombine Level to run this combine.
> Currently, I run it after LegalizeDAG.
> I would like to receive advice from you on when to run it.

I'm not sure VECTOR_SHUFFLE makes is to the DAGCombine after LegalizeDAG on most targets. Definitely not on X86.

If all types are legal and LegalizeVectorOps doesn't change anything, there are only 2 DAG combine runs that will happen, the very first one before LegalizeTypes and the very last one after LegalizeDAG. The other 2 DAG combiners are conditional on the previous legalizer step making changes. Given that and the X86 behavior I'm not sure you really have an option to delay it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96405



More information about the llvm-commits mailing list