We're now getting close to having the necessary analysis/combines etc. for the new generic llvm.abs.* intrinsics.
This patch updates the SSE/AVX ABS intrinsics to emit the generic equivalents instead of the icmp+sub+select code pattern.
Paths
| Differential D87101
[X86] Update SSE/AVX ABS intrinsics to emit llvm.abs.* (PR46851) ClosedPublic Authored by RKSimon on Sep 3 2020, 10:43 AM.
Details Summary We're now getting close to having the necessary analysis/combines etc. for the new generic llvm.abs.* intrinsics. This patch updates the SSE/AVX ABS intrinsics to emit the generic equivalents instead of the icmp+sub+select code pattern.
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 3 2020, 10:43 AM Comment Actions I think our abs intrinsic support is already sufficient to start canonicalizing to the intrinsic variant (the same is not true for min/max intrinsics). We might want to make the InstCombine change before this one, to make sure we don't lose CSE opportunities between the intrinsic and the expanded forms. Though if that's not a concern for these vector intrinsics, then this LG to me. Comment Actions LGTM - I think the odds of code that is using intrinsic vector abs inter-mixing with auto-vectorized code using the abs idiom are small. I noticed one other LLVM codegen test that might want to be updated to use the IR intrinsics to be more relevant -- llvm-project/llvm/test/CodeGen/X86/combine-abs.ll. That can be done with this patch or later. This revision is now accepted and ready to land.Sep 4 2020, 8:29 AM Comment Actions
I'm going to address that one in a followup that cleans up the x86 PABS intrinsic handling in AutoUpgrade.cpp This revision was landed with ongoing or failed builds.Sep 7 2020, 5:54 AM Closed by commit rG2853ae3c1b81: [X86] Update SSE/AVX ABS intrinsics to emit llvm.abs.* (PR46851) (authored by RKSimon). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 290268 clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/avx2-builtins.c
clang/test/CodeGen/avx512bw-builtins.c
clang/test/CodeGen/avx512f-builtins.c
clang/test/CodeGen/avx512vl-builtins.c
clang/test/CodeGen/avx512vlbw-builtins.c
clang/test/CodeGen/ssse3-builtins.c
llvm/test/CodeGen/X86/avx2-intrinsics-fast-isel.ll
llvm/test/CodeGen/X86/ssse3-intrinsics-fast-isel.ll
|