| Issue |
174602
|
| Summary |
[META][VectorCombine] Recursive shuffle combining
|
| Labels |
metaissue,
missed-optimization,
llvm::vectorcombine
|
| Assignees |
RKSimon
|
| Reporter |
RKSimon
|
Currently vectorcombine performs various shuffle(op,op) -> op(shuffle()) style folds on an individual cost-benefit basis.
However, in many cases (particular for revectorisation patterns), the cost benefit is neutral (oldcost == newcost) and we don't perform the fold in these cases unless we are certain it reduces the instruction count.
This ticket tracks the work necessary to attempt to recursively fold multiple "neutral" shuffles folds all at once, similar to what we attempt with foldShuffleToIdentity.
If a shuffle(op,op) fold has a neutral cost we can attempt to fold the candidate inner shuffle(s) immediately, and if they have a reduction in cost then we can proceed with the outer fold as well. Similarly if the inner shuffle is neutral we can attempt to fold its operands as well (up to max recursion depth).
We've already ended up doing similar things on a smaller scale to help coax folds - e.g. foldShuffleOfBinops peeks at inner shuffles in case we can more cheaply fold shuffle(shuffle()) ops.
Unlike SLP etc. I'm not intending us to take a cost hit for any fold in exchange for a net accumulative benefit.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs