[PATCH] D150969: [AArch64] Try to convert two XTN and two SMLSL to UZP1, SMLSL and SMLSL2

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 8 01:53:23 PDT 2023


jaykang10 added a comment.

In D150969#4405196 <https://reviews.llvm.org/D150969#4405196>, @dmgreen wrote:

> I don't think the add and sub are necessarily important. The same pattern can apply to any smull/umull/pmull. https://godbolt.org/z/KfrYxcvYq. I guess you are using them as a way of finding the 'other' mull instruction?
>
> I was hoping that the previous code with tryCombineOpWithUZP1 being called from performMULLCombine could just be expanded. After it had recognized and created the new UPZ1 (as that should be beneficial on its own), it could look for the other smull/umull/pmull in the pair. I think using the old code it would need to check:
>
> - That the LHS/RHS that is not TRUNC (I am going to call this `OtherOp`) is an extract_subvector high.
> - That OtherOp.operand(0) should have 2 uses, one of which is OtherOp.
> - The other use is another EXTRACT_SUBVECTOR that has a single use which is a smull/umull/pmull.
> - The smull/umull/pmull's other operand in a trunc.
> - We then use that trunc in the UZP1, using DAG.ReplaceAllUsesWith to replace the other smull/umull/pmull with a new version using the EXTRACT_SUBVECTOR low of UZP1.
>
> Do you think that would handle the cases you have seen, or is it all too complex?



In D150969#4405196 <https://reviews.llvm.org/D150969#4405196>, @dmgreen wrote:

> I don't think the add and sub are necessarily important. The same pattern can apply to any smull/umull/pmull. https://godbolt.org/z/KfrYxcvYq. I guess you are using them as a way of finding the 'other' mull instruction?
>
> I was hoping that the previous code with tryCombineOpWithUZP1 being called from performMULLCombine could just be expanded. After it had recognized and created the new UPZ1 (as that should be beneficial on its own), it could look for the other smull/umull/pmull in the pair. I think using the old code it would need to check:
>
> - That the LHS/RHS that is not TRUNC (I am going to call this `OtherOp`) is an extract_subvector high.
> - That OtherOp.operand(0) should have 2 uses, one of which is OtherOp.
> - The other use is another EXTRACT_SUBVECTOR that has a single use which is a smull/umull/pmull.
> - The smull/umull/pmull's other operand in a trunc.
> - We then use that trunc in the UZP1, using DAG.ReplaceAllUsesWith to replace the other smull/umull/pmull with a new version using the EXTRACT_SUBVECTOR low of UZP1.
>
> Do you think that would handle the cases you have seen, or is it all too complex?

You can see the case with sub and add from `pmlsl_pmlsl2_v8i16_uzp1` in this patch.


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

https://reviews.llvm.org/D150969



More information about the llvm-commits mailing list