[llvm] [AArch64][GISel] Support neon.abs intrinsic for vector types (PR #107226)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 05:18:50 PDT 2024


davemgreen wrote:

If we don't have tablegen patterns for these intrinsics it is probably best to do the same as ISel and convert them into a G_ABS, which should be selected naturally.

(Considering the intrinsic, which as far as I understand always works like an abs instruction, it would be nice if aarch64_neon_abs was not generated at-all and it used llvm.abs everywhere instead, but that is a much larger change that is outside the scope of getting them working with gisel).

I believe there are other intrinsics that should work the same way. Perhaps a combine could be added to replace the intrinsic with abs, early enough that the other optimizations we would ideally want can happen. The good thing about doing it earlier is it shouldn't have to be as careful about all the different types, it can just convert the intrinsic.

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


More information about the llvm-commits mailing list