-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[X86][AVX512] Convert _mm_reduce_* intrinsics to emit llvm.reduction intrinsics in IR #46850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
integer reductions - https://reviews.llvm.org/D87604 |
rG6c23cbc5603c |
I'm not sure what to about the fadd/fmul intrinsics. According to the intel intrinsics guide they expand as a sequence: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=reduce&expand=4562 float _mm512_reduce_add_ps (__m512 a) dst[31:0] := 0.0 But clang/gcc/icc all expand this as a standard subvector split reduction, with or without fast-math: If we are happy to just match clang's current behaviour then I think we can just repeat what I did for integer in D87604. |
I think we can change intrinsics guide to match the actual behavior. |
Great - I'll create a patch for the float reductions to match our current behaviour. |
fadd/fmul reductions - https://reviews.llvm.org/D92940 rG4855a1004d4d |
fmin/fmax reductions - https://reviews.llvm.org/D93179 rG61da20575d6c Thanks to @pengfei for completing the work on this (and @spatel for some of the FMF reduction subtleties). |
Extended Description
The mm_reduce/mm_mask_reduce style AVX512 intrinsics currently expand to a reduction code sequence in the header.
Now that we are close to handling llvm.reduction intrinsics in IR, we should be able to emit these IR intrinsics directly instead of relying on a later pass to recognise the pattern.
The text was updated successfully, but these errors were encountered: