[llvm] [AArch64] Add @llvm.experimental.vector.match (PR #101974)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 07:02:40 PDT 2024
rj-jesus wrote:
> I think we're on the same page and you may be correct in concluding the stock IR route will be cumbersome, but I think we should get to the point of knowing it to be true before picking a solution because otherwise we cannot be sure it's the correct solution.
Sure, but just to be clear, what would you like to see? Would the IR we'd be generating for something like this (https://godbolt.org/z/1bhvonGvj):
```cpp
char* find_first_byte(char *first, char *last, char *s_first, char *s_last)
{
for (; first != last; ++first)
for (char *it = s_first; it != s_last; ++it)
if (*first == *it)
return first;
return last;
}
```
with the intrinsic and stock IR help?
Also, if you think this would help make the intrinsic slightly more general, one thing we could do is remove the mask parameter. The mask only affects the first operand (the "haystack"), so we can proxy its functionality with a AND after the intrinsic call (as we currently do at the end of the generic lowering). I'm not sure this would have a big impact overall though.
Please let me know what you think. I'm happy to get the IR if you think that will help move this forward.
https://github.com/llvm/llvm-project/pull/101974
More information about the llvm-commits
mailing list