DAG patterns optimization: truncate + unsigned saturation supported by VPMOVUS* instructions in AVX-512.
Details
Details
- Reviewers
RKSimon zvi igorb - Commits
- rG9d0e7c33d3fd: X86 CodeGen: Optimized pattern for truncate with unsigned saturation.
rG143cbc425bb2: AVX-512: Optimized pattern for truncate with unsigned saturation.
rL291670: X86 CodeGen: Optimized pattern for truncate with unsigned saturation.
rL291092: AVX-512: Optimized pattern for truncate with unsigned saturation.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
The previous patch was reverted due to a failure (https://llvm.org/bugs/show_bug.cgi?id=31589).
- I fixed the bug and added a lot of test cases.
- I promised to Simon to cover non-avx512 cases with VPACKUS. Now it is in. Additional tests are in avx-trunc.ll.
../lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
31144 ↗ | (On Diff #83798) | Yes! I did not see this interface before. Thank you. |
Comment Actions
LGTM with minors
../lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
31137 ↗ | (On Diff #83804) | We canonicalize constants to RHS for UMIN/UMAX/SMIN/SMAX (see DAGCombiner::visitIMINMAX) so we only need this case. |
../test/CodeGen/X86/avx512-trunc.ll | ||
630 ↗ | (On Diff #83804) | Is it worth adding PR31589 as usat_trunc_db_1024_mem as well? |