[PATCH] D41895: [X86] Another attempt at support prefer-vector-width function attribute

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 15:10:15 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:16576-16578
+    // If we don't have VLX and we're trying to avoid 512-bit vectors we
+    // need special handling. Without VLX we have no choice but to use 512-bit
+    // vectors.
----------------
echristo wrote:
> This comment could probably use some clarification: i.e. we're going to want to use blah blah blah.
> 
> Also how is this going to work for a preferred 128 bit vector?
128 bit vectors here would probably have to split several times using shuffles to move higher elements to the lower elements, then sign_extend_vector_inreg, testd, and concat the results.


================
Comment at: lib/Target/X86/X86TargetMachine.cpp:263
+  unsigned PreferVectorWidthOverride = 0;
+  if (F.hasFnAttribute("prefer-vector-width")) {
+    StringRef Val = F.getFnAttribute("prefer-vector-width").getValueAsString();
----------------
echristo wrote:
> Bikeshed: "preferred-vector-width"?
It got named this way because gcc implemented their command line option as -mprefer-vector-width=  so then I matched that in clang and kept the attribute name matching the command line option.


https://reviews.llvm.org/D41895





More information about the llvm-commits mailing list