[PATCH] D41341: [X86] WIP disable 512-bit vectors during type legalization for prefer-vector-width

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 22:42:22 PST 2017


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86Subtarget.h:570
 
   bool preferAVX256() const { return PreferAVX256; }
 
----------------
hfinkel wrote:
> This sits on top of D41096? I thought it would replace it. Do we need to prefer AVX2 if we have AVX-512 without using zmm?
> 
It's not prefer AVX2. It's prefer 256-bit vectors. The name could be better..

>From our previous discussions we still wanted to "prefer 256-bit" even when the user uses 512-bit explicitly unless they pass -mprefer-vector-width=512. And we need the prefer flag to be a property of the affected CPUs. So this flag represents those two things.

We can also use this flag to do targeted fixes to disable extensions to 512-bit when the CPU prefers 256-bit, but we weren't able to disable the legalizer. I think the LowerShift and LowerMULH fixes in this patch might want to be qualified with only "prefer 256-bit" rather than 512-bit types are illegal.


https://reviews.llvm.org/D41341





More information about the llvm-commits mailing list