[PATCH] D28455: [X86] Fix PR30926 - Add patterns for optimizing cvtsi2ss, cvtsi2sd, cvtsd2ss and cvtss2sd clang intrinsic sequences

Elad Cohen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 05:42:58 PST 2017


eladcohen added inline comments.


================
Comment at: lib/Target/X86/X86InstrSSE.td:1962
+}
+let Predicates = [HasAVX] in {
+def : Pat<(v4f32 (X86Movss
----------------
RKSimon wrote:
> Should this be [UseAVX] and then add AVX512 patterns in X86InstrAVX512.td ?
For AVX512 I see two types of intrinsics that correspond to these instructions:
1) With Rounding mode or masks (e.g. _mm_cvt_roundi64_sd) - These will generate a builtin and not generic IR, so they don't require any new patterns.
2) Without rounding mode and masks (e.g. _mm_cvti32_sd) - These are mapped by macros to their matching AVX instruction which are handled in the above patterns - And that's why I want [HasAVX] to catch them.


================
Comment at: lib/Target/X86/X86InstrSSE.td:1994
+          (Int_VCVTSI2SDrr VR128:$dst, GR32:$src)>;
+}
+
----------------
RKSimon wrote:
> It's more typical to put the AVX patterns before the SSE.
I'll change this. Thanks


https://reviews.llvm.org/D28455





More information about the llvm-commits mailing list