[llvm] [X86] matchAddressRecursively - move ZERO_EXTEND patterns into matchIndexRecursively (PR #85081)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 07:33:56 PDT 2024


RicoAfoat wrote:

@RKSimon I tried but failed to find an elegant solution. 

As far as I'm concerned, move all `ZERO_EXTEND` patterns to `matchIndexRecursively` and literally match this patterns recursively would fix the issue. 

But it's hard for me to find a condition which tells whether the pattern match is successful. As mentioned above, `N!=matchIndexRecursively...` will not help. It seems that there's two way left:

1. Modify the return value of `matchIndexRecursively`, which needs to modify all the caller function as well. Maybe hide all of this into a adapter would be elegant.
2. Leave some redundant code in `matchAddressRecursively`, which is also not elegant.

Hope this helpful to you and I would like to know how will you solve the whole problem. 

https://github.com/llvm/llvm-project/pull/85081


More information about the llvm-commits mailing list